/* Copyright 2021-2023 NXP
 *
 * NXP Confidential. This software is owned or controlled by NXP and may only
 * be used strictly in accordance with the applicable license terms.  By
 * expressly accepting such terms or by downloading, installing, activating
 * and/or otherwise using the software, you are agreeing that you have read,
 * and that you agree to comply with and are bound by, such license terms.  If
 * you do not agree to be bound by the applicable license terms, then you may
 * not retain, install, activate or otherwise use the software.
 */

#include <UwbApi.h>
#include <SR040_RadioCfg_Define.h>
#include <phNxpLogApis_UwbApi.h>

/* Rx_SP0_BPRF_Prmbl64_Sfd0_Sts0_Data6M8 @ idx=0x00 */
static tUWBAPI_STATUS RadioConfig_Rx_SP0_BPRF_Prmbl64_Sfd0_Sts0_Data6M8_0x00(bool force_update);

/* Rx_SP1_BPRF_Prmbl64_Sfd0_Sts64_1_Data6M8 @ idx=0x01 */
static tUWBAPI_STATUS RadioConfig_Rx_SP1_BPRF_Prmbl64_Sfd0_Sts64_1_Data6M8_0x01(bool force_update);

/* Rx_SP0_BPRF_Prmbl64_Sfd2_Sts0_Data6M8 @ idx=0x02 */
static tUWBAPI_STATUS RadioConfig_Rx_SP0_BPRF_Prmbl64_Sfd2_Sts0_Data6M8_0x02(bool force_update);

/* Rx_SP1_BPRF_Prmbl64_Sfd2_Sts64_1_Data6M8 @ idx=0x03 */
static tUWBAPI_STATUS RadioConfig_Rx_SP1_BPRF_Prmbl64_Sfd2_Sts64_1_Data6M8_0x03(bool force_update);

/* Rx_SP0_hprf_Prmbl32_Sfd2_Sts0_Data6M8 @ idx=0x04 */
static tUWBAPI_STATUS RadioConfig_Rx_SP0_hprf_Prmbl32_Sfd2_Sts0_Data6M8_0x04(bool force_update);

/* Rx_SP0_hprf_Prmbl32_Sfd2_Sts0_Data7M8 @ idx=0x05 */
static tUWBAPI_STATUS RadioConfig_Rx_SP0_hprf_Prmbl32_Sfd2_Sts0_Data7M8_0x05(bool force_update);

/* Rx_SP0_hprf_Prmbl64_Sfd2_Sts0_Data6M8 @ idx=0x06 */
static tUWBAPI_STATUS RadioConfig_Rx_SP0_hprf_Prmbl64_Sfd2_Sts0_Data6M8_0x06(bool force_update);

/* Rx_SP0_hprf_Prmbl64_Sfd2_Sts0_Data7M8 @ idx=0x07 */
static tUWBAPI_STATUS RadioConfig_Rx_SP0_hprf_Prmbl64_Sfd2_Sts0_Data7M8_0x07(bool force_update);

/* Rx_SP1_hprf_Prmbl32_Sfd2_Sts64_1_Data6M8 @ idx=0x08 */
static tUWBAPI_STATUS RadioConfig_Rx_SP1_hprf_Prmbl32_Sfd2_Sts64_1_Data6M8_0x08(bool force_update);

/* Rx_SP1_hprf_Prmbl64_Sfd2_Sts64_2_Data6M8 @ idx=0x09 */
static tUWBAPI_STATUS RadioConfig_Rx_SP1_hprf_Prmbl64_Sfd2_Sts64_2_Data6M8_0x09(bool force_update);

/* Rx_SP1_hprf_Prmbl64_Sfd2_Sts64_1_Data6M8 @ idx=0x0A */
static tUWBAPI_STATUS RadioConfig_Rx_SP1_hprf_Prmbl64_Sfd2_Sts64_1_Data6M8_0x0A(bool force_update);

/* Rx_Empty_512_0x0B @ idx=0x0B */
static tUWBAPI_STATUS RadioConfig_Rx_Empty_512_0x0B_0x0B(bool force_update);

/* Rx_Empty_512_0x0C @ idx=0x0C */
static tUWBAPI_STATUS RadioConfig_Rx_Empty_512_0x0C_0x0C(bool force_update);

/* Rx_SP0_BPRF_Prmbl64_Sfd0_Sts0_Data6M8 @ idx=0x0D */
static tUWBAPI_STATUS RadioConfig_Rx_SP0_BPRF_Prmbl64_Sfd0_Sts0_Data6M8_0x0D(bool force_update);

/* Rx_SP1_BPRF_Prmbl64_Sfd0_Sts64_1_Data6M8 @ idx=0x0E */
static tUWBAPI_STATUS RadioConfig_Rx_SP1_BPRF_Prmbl64_Sfd0_Sts64_1_Data6M8_0x0E(bool force_update);

/* Rx_Empty_512_0x0F @ idx=0x0F */
static tUWBAPI_STATUS RadioConfig_Rx_Empty_512_0x0F_0x0F(bool force_update);

/* Tx_SP0_BPRF_Prmbl64_Sfd0_Sts0_Data6M8 @ idx=0x10 */
static tUWBAPI_STATUS RadioConfig_Tx_SP0_BPRF_Prmbl64_Sfd0_Sts0_Data6M8_0x10(bool force_update);

/* Tx_SP1_BPRF_Prmbl64_Sfd0_Sts64_1_Data6M8 @ idx=0x11 */
static tUWBAPI_STATUS RadioConfig_Tx_SP1_BPRF_Prmbl64_Sfd0_Sts64_1_Data6M8_0x11(bool force_update);

/* Tx_SP0_BPRF_Prmbl64_Sfd2_Sts0_Data6M8 @ idx=0x12 */
static tUWBAPI_STATUS RadioConfig_Tx_SP0_BPRF_Prmbl64_Sfd2_Sts0_Data6M8_0x12(bool force_update);

/* Tx_SP1_BPRF_Prmbl64_Sfd2_Sts64_1_Data6M8 @ idx=0x13 */
static tUWBAPI_STATUS RadioConfig_Tx_SP1_BPRF_Prmbl64_Sfd2_Sts64_1_Data6M8_0x13(bool force_update);

/* Tx_SP0_hprf_Prmbl32_Sfd2_Sts0_Data6M8 @ idx=0x14 */
static tUWBAPI_STATUS RadioConfig_Tx_SP0_hprf_Prmbl32_Sfd2_Sts0_Data6M8_0x14(bool force_update);

/* Tx_SP0_hprf_Prmbl32_Sfd2_Sts0_Data7M8 @ idx=0x15 */
static tUWBAPI_STATUS RadioConfig_Tx_SP0_hprf_Prmbl32_Sfd2_Sts0_Data7M8_0x15(bool force_update);

/* Tx_SP0_hprf_Prmbl64_Sfd2_Sts0_Data6M8 @ idx=0x16 */
static tUWBAPI_STATUS RadioConfig_Tx_SP0_hprf_Prmbl64_Sfd2_Sts0_Data6M8_0x16(bool force_update);

/* Tx_SP0_hprf_Prmbl64_Sfd2_Sts0_Data7M8 @ idx=0x17 */
static tUWBAPI_STATUS RadioConfig_Tx_SP0_hprf_Prmbl64_Sfd2_Sts0_Data7M8_0x17(bool force_update);

/* Tx_SP1_hprf_Prmbl32_Sfd2_Sts64_1_Data6M8 @ idx=0x18 */
static tUWBAPI_STATUS RadioConfig_Tx_SP1_hprf_Prmbl32_Sfd2_Sts64_1_Data6M8_0x18(bool force_update);

/* Tx_SP1_hprf_Prmbl64_Sfd2_Sts64_2_Data6M8 @ idx=0x19 */
static tUWBAPI_STATUS RadioConfig_Tx_SP1_hprf_Prmbl64_Sfd2_Sts64_2_Data6M8_0x19(bool force_update);

/* Tx_SP1_hprf_Prmbl64_Sfd2_Sts64_1_Data6M8 @ idx=0x1A */
static tUWBAPI_STATUS RadioConfig_Tx_SP1_hprf_Prmbl64_Sfd2_Sts64_1_Data6M8_0x1A(bool force_update);

/* Tx_Empty_256_0x1B @ idx=0x1B */
static tUWBAPI_STATUS RadioConfig_Tx_Empty_256_0x1B_0x1B(bool force_update);

/* Tx_Empty_256_0x1C @ idx=0x1C */
static tUWBAPI_STATUS RadioConfig_Tx_Empty_256_0x1C_0x1C(bool force_update);

/* Tx_SP0_BPRF_Prmbl64_Sfd0_Sts0_Data6M8 @ idx=0x1D */
static tUWBAPI_STATUS RadioConfig_Tx_SP0_BPRF_Prmbl64_Sfd0_Sts0_Data6M8_0x1D(bool force_update);

/* Tx_SP1_BPRF_Prmbl64_Sfd0_Sts64_1_Data6M8 @ idx=0x1E */
static tUWBAPI_STATUS RadioConfig_Tx_SP1_BPRF_Prmbl64_Sfd0_Sts64_1_Data6M8_0x1E(bool force_update);

/* Tx_DDFSCW @ idx=0x1F */
static tUWBAPI_STATUS RadioConfig_Tx_DDFSCW_0x1F(bool force_update);

tUWBAPI_STATUS RadioConfig_full(bool force_update)
{
    tUWBAPI_STATUS status;
    if (!force_update) {
        uint16_t outCRC = 0;
        status          = UwbApi_RadioConfigGetAllCrc(&outCRC);
        if (status == UWBAPI_STATUS_OK) {
            if (SR040_RADIO_CFG_FULL_CRC == outCRC) {
                LOG_I("Over All CRC is Same. So skipping");
                goto exit;
            }
        }
        else {
            LOG_W("UwbApi_RadioConfigGetAllCrc Failed");
        }
    }

    status = RadioConfig_Rx_SP0_BPRF_Prmbl64_Sfd0_Sts0_Data6M8_0x00(force_update);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }

    status = RadioConfig_Rx_SP1_BPRF_Prmbl64_Sfd0_Sts64_1_Data6M8_0x01(force_update);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }

    status = RadioConfig_Rx_SP0_BPRF_Prmbl64_Sfd2_Sts0_Data6M8_0x02(force_update);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }

    status = RadioConfig_Rx_SP1_BPRF_Prmbl64_Sfd2_Sts64_1_Data6M8_0x03(force_update);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }

    status = RadioConfig_Rx_SP0_hprf_Prmbl32_Sfd2_Sts0_Data6M8_0x04(force_update);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }

    status = RadioConfig_Rx_SP0_hprf_Prmbl32_Sfd2_Sts0_Data7M8_0x05(force_update);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }

    status = RadioConfig_Rx_SP0_hprf_Prmbl64_Sfd2_Sts0_Data6M8_0x06(force_update);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }

    status = RadioConfig_Rx_SP0_hprf_Prmbl64_Sfd2_Sts0_Data7M8_0x07(force_update);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }

    status = RadioConfig_Rx_SP1_hprf_Prmbl32_Sfd2_Sts64_1_Data6M8_0x08(force_update);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }

    status = RadioConfig_Rx_SP1_hprf_Prmbl64_Sfd2_Sts64_2_Data6M8_0x09(force_update);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }

    status = RadioConfig_Rx_SP1_hprf_Prmbl64_Sfd2_Sts64_1_Data6M8_0x0A(force_update);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }

    status = RadioConfig_Rx_Empty_512_0x0B_0x0B(force_update);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }

    status = RadioConfig_Rx_Empty_512_0x0C_0x0C(force_update);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }

    status = RadioConfig_Rx_SP0_BPRF_Prmbl64_Sfd0_Sts0_Data6M8_0x0D(force_update);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }

    status = RadioConfig_Rx_SP1_BPRF_Prmbl64_Sfd0_Sts64_1_Data6M8_0x0E(force_update);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }

    status = RadioConfig_Rx_Empty_512_0x0F_0x0F(force_update);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }

    status = RadioConfig_Tx_SP0_BPRF_Prmbl64_Sfd0_Sts0_Data6M8_0x10(force_update);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }

    status = RadioConfig_Tx_SP1_BPRF_Prmbl64_Sfd0_Sts64_1_Data6M8_0x11(force_update);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }

    status = RadioConfig_Tx_SP0_BPRF_Prmbl64_Sfd2_Sts0_Data6M8_0x12(force_update);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }

    status = RadioConfig_Tx_SP1_BPRF_Prmbl64_Sfd2_Sts64_1_Data6M8_0x13(force_update);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }

    status = RadioConfig_Tx_SP0_hprf_Prmbl32_Sfd2_Sts0_Data6M8_0x14(force_update);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }

    status = RadioConfig_Tx_SP0_hprf_Prmbl32_Sfd2_Sts0_Data7M8_0x15(force_update);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }

    status = RadioConfig_Tx_SP0_hprf_Prmbl64_Sfd2_Sts0_Data6M8_0x16(force_update);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }

    status = RadioConfig_Tx_SP0_hprf_Prmbl64_Sfd2_Sts0_Data7M8_0x17(force_update);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }

    status = RadioConfig_Tx_SP1_hprf_Prmbl32_Sfd2_Sts64_1_Data6M8_0x18(force_update);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }

    status = RadioConfig_Tx_SP1_hprf_Prmbl64_Sfd2_Sts64_2_Data6M8_0x19(force_update);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }

    status = RadioConfig_Tx_SP1_hprf_Prmbl64_Sfd2_Sts64_1_Data6M8_0x1A(force_update);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }

    status = RadioConfig_Tx_Empty_256_0x1B_0x1B(force_update);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }

    status = RadioConfig_Tx_Empty_256_0x1C_0x1C(force_update);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }

    status = RadioConfig_Tx_SP0_BPRF_Prmbl64_Sfd0_Sts0_Data6M8_0x1D(force_update);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }

    status = RadioConfig_Tx_SP1_BPRF_Prmbl64_Sfd0_Sts64_1_Data6M8_0x1E(force_update);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }

    status = RadioConfig_Tx_DDFSCW_0x1F(force_update);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
exit:
    // Exit code comes here
    return status;
}

// Rx_SP0_BPRF_Prmbl64_Sfd0_Sts0_Data6M8 :  #Start

static tUWBAPI_STATUS RadioConfig_Rx_SP0_BPRF_Prmbl64_Sfd0_Sts0_Data6M8_0x00(bool force_update)
{
    tUWBAPI_STATUS status;
    uint16_t respLen = 0x05;
    uint8_t respBuf[5];
    const uint8_t current_idx  = SR040_RADIO_CFG_IDX_0x00_IDX;
    const uint16_t expectedCrc = SR040_RADIO_CFG_IDX_0x00_CRC;
    /* clang-format off */
    const uint8_t UCI_RadioCfg_Init_Seq[] =
    {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00,0x02,
        kSR040_RadioCrc_InitDownload,
        SR040_RADIO_CFG_IDX_0x00_IDX /* index */
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_00[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x00, 0x00,
        0x80,
        0x01, 0x00, 0x00, 0x00, 0x88, 0x13, 0x00, 0x05, 0x10, 0x14, 0x74, 0x00, 0x01, 0x00, 0x00, 0x00, 0xFF, 0x7F, 0x00, 0x80, 0x00, 0x00, 0x56, 0x45, 0x04, 0x7C, 0x1C, 0x40, 0x02, 0x05, 0x35, 0x04, 0x7E, 0x00, 0x00, 0x00, 0x8F, 0x98, 0x19, 0x00, 0x04, 0x70, 0x00, 0x00, 0x10, 0x10, 0x14, 0x0C, 0xC4, 0x00, 0x06, 0x00, 0x08, 0x26, 0x54, 0x00, 0x04, 0x0C, 0x04, 0x04, 0x1C, 0x07, 0x04, 0x1C, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x03, 0x02, 0x00, 0x19, 0x02, 0x19, 0x02, 0x00, 0x03, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0x00, 0x0F, 0x00, 0xFF, 0x03, 0xFF, 0x03, 0x00, 0x2E, 0x03, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x50, 0x03, 0x60, 0x08, 0x01, 0x02, 0x00, 0x03, 0x04, 0x06, 0x06, 0x06, 0x38, 0x04, 0x0A, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00,
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_01[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x80, 0x00,
        0x80,
        0x09, 0x00, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x0F, 0x07, 0x01, 0x02, 0x00, 0x00, 0x08, 0x08, 0x0F, 0x0F, 0x05, 0x07, 0x00, 0x09, 0x00, 0x11, 0x00, 0x31, 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x01, 0x01, 0x02, 0x03, 0x08, 0x08, 0x08, 0x08, 0x04, 0x05, 0x07, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9A, 0x10, 0x02, 0x04, 0x07, 0x10, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x33, 0x0A, 0x00, 0x00, 0x06, 0x03, 0x00, 0x00, 0x01, 0x00, 0x6F, 0x00, 0x00, 0x00, 0x29, 0x00, 0x01, 0x01, 0x04, 0x00, 0xFE, 0x21, 0x00, 0x00, 0x00, 0x24, 0x04, 0x00, 0x26, 0x0C, 0x01, 0x0C, 0x05, 0x01,
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_02[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x00, 0x01,
        0x80,
        0xFF, 0xFF, 0x59, 0x00, 0x00, 0x20, 0x11, 0x00, 0x07, 0x02, 0x01, 0x00, 0x4A, 0x01, 0x30, 0x00, 0x01, 0x2F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xCD, 0x80, 0x02, 0x10, 0xC8, 0xC2, 0x02, 0x10, 0x22, 0x10, 0x10, 0x0D, 0x00, 0x82, 0x62, 0x12, 0xCD, 0x95, 0x2F, 0x1C, 0xC9, 0xD6, 0xDE, 0x58, 0xBA, 0x33, 0xD5, 0x1F, 0x08, 0x86, 0xE2, 0x06, 0x00, 0xEB, 0x60, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x7F, 0x7F, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00,
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_03[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x80, 0x01,
        0x80,
        0x5E, 0x4F, 0x08, 0x00, 0x00, 0x00, 0x00, 0x12, 0xC2, 0xD3, 0xA4, 0x06, 0xDA, 0xF1, 0xA2, 0x65, 0x79, 0x61, 0x41, 0x00, 0x8A, 0x98, 0x36, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x79, 0x1F, 0x0F, 0x72, 0xFF, 0x2C, 0xF5, 0x32, 0x8A, 0x98, 0x36, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x1C, 0xFE, 0xF8, 0x07, 0x00, 0x70, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x04, 0x00,
    };
    const uint8_t UCI_RadioCfg_Flash_Seq[] =
    {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00,0x03,
        kSR040_RadioCrc_Finish,
        0xF1, 0xB1
    };
    /* clang-format on */
    if (!force_update) {
        uint16_t gotCrc = 0;
        status          = UwbApi_RadioConfigGetCrc(current_idx, &gotCrc);
        if (status == UWBAPI_STATUS_OK) {
            if (gotCrc == expectedCrc) {
                /* Same radio configs, so skip */
                goto exit;
            }
        }
    }
restart:
    status =
        UwbApi_SendRawCommand((uint8_t *)&UCI_RadioCfg_Init_Seq[0], sizeof(UCI_RadioCfg_Init_Seq), respBuf, &respLen);
    if (status == UWBAPI_STATUS_HPD_WAKEUP) {
        goto restart;
    }
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_00[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_00), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_01[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_01), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_02[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_02), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_03[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_03), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status =
        UwbApi_SendRawCommand((uint8_t *)&UCI_RadioCfg_Flash_Seq[0], sizeof(UCI_RadioCfg_Flash_Seq), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }

exit:
    // Exit code comes here
    return status;
}

// Rx_SP0_BPRF_Prmbl64_Sfd0_Sts0_Data6M8 :  #End

// Rx_SP1_BPRF_Prmbl64_Sfd0_Sts64_1_Data6M8 :  #Start

static tUWBAPI_STATUS RadioConfig_Rx_SP1_BPRF_Prmbl64_Sfd0_Sts64_1_Data6M8_0x01(bool force_update)
{
    tUWBAPI_STATUS status;
    uint16_t respLen = 0x05;
    uint8_t respBuf[5];
    const uint8_t current_idx  = SR040_RADIO_CFG_IDX_0x01_IDX;
    const uint16_t expectedCrc = SR040_RADIO_CFG_IDX_0x01_CRC;
    /* clang-format off */
    const uint8_t UCI_RadioCfg_Init_Seq[] =
    {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00,0x02,
        kSR040_RadioCrc_InitDownload,
        SR040_RADIO_CFG_IDX_0x01_IDX /* index */
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_00[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x00, 0x00,
        0x80,
        0x01, 0x00, 0x00, 0x00, 0x88, 0x13, 0x00, 0x05, 0x10, 0x14, 0x74, 0x00, 0x01, 0x00, 0x00, 0x00, 0xFF, 0x7F, 0x00, 0x80, 0x00, 0x00, 0x56, 0x45, 0x04, 0x7C, 0x1C, 0x40, 0x02, 0x05, 0x35, 0x04, 0x7E, 0x00, 0x00, 0x00, 0x8F, 0x98, 0x19, 0x00, 0x04, 0x70, 0x00, 0x00, 0x10, 0x10, 0x14, 0x0C, 0xC4, 0x00, 0x06, 0x00, 0x08, 0x26, 0x54, 0x00, 0x04, 0x0C, 0x04, 0x04, 0x1C, 0x07, 0x04, 0x1C, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x03, 0x02, 0x00, 0x19, 0x02, 0x19, 0x02, 0x00, 0x03, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0x00, 0x0F, 0x00, 0x3F, 0x00, 0xFF, 0x03, 0x00, 0x2E, 0x03, 0x00, 0x10, 0x00, 0x08, 0x00, 0x10, 0x00, 0x50, 0x03, 0x60, 0x08, 0x01, 0x02, 0x00, 0x03, 0x04, 0x06, 0x06, 0x06, 0x38, 0x04, 0x0A, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00,
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_01[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x80, 0x00,
        0x80,
        0x09, 0x00, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x0F, 0x07, 0x01, 0x02, 0x00, 0x00, 0x08, 0x08, 0x0F, 0x0F, 0x05, 0x07, 0x00, 0x09, 0x00, 0x11, 0x00, 0x31, 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x01, 0x01, 0x02, 0x03, 0x08, 0x08, 0x08, 0x08, 0x04, 0x05, 0x07, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9A, 0x10, 0x02, 0x04, 0x07, 0x10, 0x2E, 0x3F, 0x00, 0x00, 0x00, 0x37, 0x0A, 0x06, 0x00, 0x06, 0x03, 0x00, 0x00, 0x01, 0x00, 0x6F, 0x00, 0x00, 0x00, 0x29, 0x00, 0x01, 0x01, 0x04, 0x00, 0xFE, 0x21, 0x00, 0x00, 0x00, 0x24, 0x04, 0x00, 0x26, 0x0C, 0x01, 0x0C, 0x05, 0x01,
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_02[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x00, 0x01,
        0x80,
        0xFF, 0xFF, 0x59, 0x00, 0x00, 0x20, 0x11, 0x00, 0x07, 0x02, 0x01, 0x00, 0x4A, 0x01, 0x30, 0x00, 0x01, 0x2F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xCD, 0x80, 0x02, 0x10, 0xC8, 0xC2, 0x02, 0x10, 0x22, 0x10, 0x10, 0x0D, 0x00, 0x82, 0x62, 0x12, 0xCD, 0x95, 0x2F, 0x1C, 0xC9, 0xD6, 0xDE, 0x58, 0xBA, 0x33, 0xD5, 0x1F, 0x08, 0x86, 0xE2, 0x06, 0x00, 0xEB, 0x60, 0x04, 0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x6A, 0x7F, 0x00, 0x6A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00,
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_03[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x80, 0x01,
        0x80,
        0x5E, 0x4F, 0x04, 0x00, 0x00, 0x00, 0x00, 0x24, 0xC2, 0xD3, 0xA4, 0x06, 0xDA, 0xF1, 0xA2, 0x65, 0x79, 0x61, 0x41, 0x00, 0x8A, 0x98, 0x36, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x79, 0x1F, 0x0F, 0x72, 0xFF, 0x2C, 0xF5, 0x32, 0x8A, 0x98, 0x36, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x1C, 0xFE, 0xF8, 0x07, 0x00, 0x70, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x04, 0x00,
    };
    const uint8_t UCI_RadioCfg_Flash_Seq[] =
    {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00,0x03,
        kSR040_RadioCrc_Finish,
        0xE1, 0x36
    };
    /* clang-format on */
    if (!force_update) {
        uint16_t gotCrc = 0;
        status          = UwbApi_RadioConfigGetCrc(current_idx, &gotCrc);
        if (status == UWBAPI_STATUS_OK) {
            if (gotCrc == expectedCrc) {
                /* Same radio configs, so skip */
                goto exit;
            }
        }
    }
restart:
    status =
        UwbApi_SendRawCommand((uint8_t *)&UCI_RadioCfg_Init_Seq[0], sizeof(UCI_RadioCfg_Init_Seq), respBuf, &respLen);
    if (status == UWBAPI_STATUS_HPD_WAKEUP) {
        goto restart;
    }
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_00[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_00), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_01[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_01), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_02[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_02), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_03[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_03), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status =
        UwbApi_SendRawCommand((uint8_t *)&UCI_RadioCfg_Flash_Seq[0], sizeof(UCI_RadioCfg_Flash_Seq), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }

exit:
    // Exit code comes here
    return status;
}

// Rx_SP1_BPRF_Prmbl64_Sfd0_Sts64_1_Data6M8 :  #End

// Rx_SP0_BPRF_Prmbl64_Sfd2_Sts0_Data6M8 :  #Start

static tUWBAPI_STATUS RadioConfig_Rx_SP0_BPRF_Prmbl64_Sfd2_Sts0_Data6M8_0x02(bool force_update)
{
    tUWBAPI_STATUS status;
    uint16_t respLen = 0x05;
    uint8_t respBuf[5];
    const uint8_t current_idx  = SR040_RADIO_CFG_IDX_0x02_IDX;
    const uint16_t expectedCrc = SR040_RADIO_CFG_IDX_0x02_CRC;
    /* clang-format off */
    const uint8_t UCI_RadioCfg_Init_Seq[] =
    {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00,0x02,
        kSR040_RadioCrc_InitDownload,
        SR040_RADIO_CFG_IDX_0x02_IDX /* index */
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_00[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x00, 0x00,
        0x80,
        0x01, 0x00, 0x00, 0x00, 0x88, 0x13, 0x00, 0x05, 0x10, 0x14, 0x74, 0x00, 0x01, 0x00, 0x00, 0x00, 0xFF, 0x7F, 0x00, 0x80, 0x00, 0x00, 0x56, 0x45, 0x04, 0x7C, 0x1C, 0x40, 0x02, 0x05, 0x35, 0x04, 0x7E, 0x00, 0x00, 0x00, 0x8F, 0x98, 0x19, 0x00, 0x04, 0x70, 0x00, 0x00, 0x10, 0x10, 0x14, 0x0C, 0xC4, 0x00, 0x06, 0x00, 0x08, 0x26, 0x54, 0x00, 0x04, 0x0C, 0x04, 0x04, 0x1C, 0x07, 0x04, 0x1C, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x03, 0x02, 0x00, 0x19, 0x02, 0x19, 0x02, 0x00, 0x03, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0x00, 0x0F, 0x00, 0xFF, 0x03, 0xFF, 0x03, 0x00, 0x2E, 0x03, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x50, 0x03, 0x60, 0x08, 0x01, 0x02, 0x00, 0x03, 0x04, 0x06, 0x06, 0x06, 0x38, 0x04, 0x0A, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00,
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_01[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x80, 0x00,
        0x80,
        0x09, 0x00, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x0F, 0x07, 0x01, 0x02, 0x00, 0x00, 0x08, 0x08, 0x0F, 0x0F, 0x05, 0x07, 0x00, 0x09, 0x00, 0x11, 0x00, 0x31, 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x01, 0x01, 0x02, 0x03, 0x08, 0x08, 0x08, 0x08, 0x04, 0x05, 0x07, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x18, 0x02, 0x08, 0x07, 0x10, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x33, 0x0A, 0x00, 0x00, 0x06, 0x03, 0x00, 0x00, 0x01, 0x00, 0x6F, 0x00, 0x00, 0x00, 0x29, 0x00, 0x01, 0x01, 0x04, 0x00, 0xFE, 0x21, 0x00, 0x00, 0x00, 0x24, 0x04, 0x00, 0x26, 0x0C, 0x01, 0x0C, 0x05, 0x01,
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_02[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x00, 0x01,
        0x80,
        0xFF, 0xFF, 0x59, 0x00, 0x00, 0x20, 0x11, 0x00, 0x07, 0x02, 0x01, 0x00, 0x4A, 0x01, 0x30, 0x00, 0x01, 0x2F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xCD, 0x80, 0x02, 0x10, 0xC8, 0xC2, 0x02, 0x10, 0x22, 0x10, 0x10, 0x0D, 0x00, 0x82, 0x62, 0x12, 0xCD, 0x95, 0x2F, 0x1C, 0xC9, 0xD6, 0xDE, 0x58, 0xBA, 0x33, 0xD5, 0x1F, 0x08, 0x86, 0xE2, 0x06, 0x00, 0xEB, 0x60, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x7F, 0x7F, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00,
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_03[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x80, 0x01,
        0x80,
        0x5E, 0x4F, 0x08, 0x00, 0x00, 0x00, 0x00, 0x12, 0xC2, 0xD3, 0xA4, 0x06, 0xDA, 0xF1, 0xA2, 0x65, 0x79, 0x61, 0x41, 0x00, 0x8A, 0x98, 0x36, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x79, 0x1F, 0x0F, 0x72, 0xFF, 0x2C, 0xF5, 0x32, 0x8A, 0x98, 0x36, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x1C, 0xFE, 0xF8, 0x07, 0x00, 0x70, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x04, 0x00,
    };
    const uint8_t UCI_RadioCfg_Flash_Seq[] =
    {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00,0x03,
        kSR040_RadioCrc_Finish,
        0xA7, 0x08
    };
    /* clang-format on */
    if (!force_update) {
        uint16_t gotCrc = 0;
        status          = UwbApi_RadioConfigGetCrc(current_idx, &gotCrc);
        if (status == UWBAPI_STATUS_OK) {
            if (gotCrc == expectedCrc) {
                /* Same radio configs, so skip */
                goto exit;
            }
        }
    }
restart:
    status =
        UwbApi_SendRawCommand((uint8_t *)&UCI_RadioCfg_Init_Seq[0], sizeof(UCI_RadioCfg_Init_Seq), respBuf, &respLen);
    if (status == UWBAPI_STATUS_HPD_WAKEUP) {
        goto restart;
    }
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_00[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_00), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_01[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_01), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_02[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_02), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_03[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_03), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status =
        UwbApi_SendRawCommand((uint8_t *)&UCI_RadioCfg_Flash_Seq[0], sizeof(UCI_RadioCfg_Flash_Seq), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }

exit:
    // Exit code comes here
    return status;
}

// Rx_SP0_BPRF_Prmbl64_Sfd2_Sts0_Data6M8 :  #End

// Rx_SP1_BPRF_Prmbl64_Sfd2_Sts64_1_Data6M8 :  #Start

static tUWBAPI_STATUS RadioConfig_Rx_SP1_BPRF_Prmbl64_Sfd2_Sts64_1_Data6M8_0x03(bool force_update)
{
    tUWBAPI_STATUS status;
    uint16_t respLen = 0x05;
    uint8_t respBuf[5];
    const uint8_t current_idx  = SR040_RADIO_CFG_IDX_0x03_IDX;
    const uint16_t expectedCrc = SR040_RADIO_CFG_IDX_0x03_CRC;
    /* clang-format off */
    const uint8_t UCI_RadioCfg_Init_Seq[] =
    {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00,0x02,
        kSR040_RadioCrc_InitDownload,
        SR040_RADIO_CFG_IDX_0x03_IDX /* index */
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_00[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x00, 0x00,
        0x80,
        0x01, 0x00, 0x00, 0x00, 0x88, 0x13, 0x00, 0x05, 0x10, 0x14, 0x74, 0x00, 0x01, 0x00, 0x00, 0x00, 0xFF, 0x7F, 0x00, 0x80, 0x00, 0x00, 0x56, 0x45, 0x04, 0x7C, 0x1C, 0x40, 0x02, 0x05, 0x35, 0x04, 0x7E, 0x00, 0x00, 0x00, 0x8F, 0x98, 0x19, 0x00, 0x04, 0x70, 0x00, 0x00, 0x10, 0x10, 0x14, 0x0C, 0xC4, 0x00, 0x06, 0x00, 0x08, 0x26, 0x54, 0x00, 0x04, 0x0C, 0x04, 0x04, 0x1C, 0x07, 0x04, 0x1C, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x03, 0x02, 0x00, 0x19, 0x02, 0x19, 0x02, 0x00, 0x03, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0x00, 0x0F, 0x00, 0x3F, 0x00, 0xFF, 0x03, 0x00, 0x2E, 0x03, 0x00, 0x10, 0x00, 0x08, 0x00, 0x10, 0x00, 0x50, 0x03, 0x60, 0x08, 0x01, 0x02, 0x00, 0x03, 0x04, 0x06, 0x06, 0x06, 0x38, 0x04, 0x0A, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00,
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_01[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x80, 0x00,
        0x80,
        0x09, 0x00, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x0F, 0x07, 0x01, 0x02, 0x00, 0x00, 0x08, 0x08, 0x0F, 0x0F, 0x05, 0x07, 0x00, 0x09, 0x00, 0x11, 0x00, 0x31, 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x01, 0x01, 0x02, 0x03, 0x08, 0x08, 0x08, 0x08, 0x04, 0x05, 0x07, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x18, 0x02, 0x08, 0x07, 0x10, 0x2E, 0x3F, 0x00, 0x00, 0x00, 0x37, 0x0A, 0x06, 0x00, 0x06, 0x03, 0x00, 0x00, 0x01, 0x00, 0x6F, 0x00, 0x00, 0x00, 0x29, 0x00, 0x01, 0x01, 0x04, 0x00, 0xFE, 0x21, 0x00, 0x00, 0x00, 0x24, 0x04, 0x00, 0x26, 0x0C, 0x01, 0x0C, 0x05, 0x01,
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_02[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x00, 0x01,
        0x80,
        0xFF, 0xFF, 0x59, 0x00, 0x00, 0x20, 0x11, 0x00, 0x07, 0x02, 0x01, 0x00, 0x4A, 0x01, 0x30, 0x00, 0x01, 0x2F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xCD, 0x80, 0x02, 0x10, 0xC8, 0xC2, 0x02, 0x10, 0x22, 0x10, 0x10, 0x0D, 0x00, 0x82, 0x62, 0x12, 0xCD, 0x95, 0x2F, 0x1C, 0xC9, 0xD6, 0xDE, 0x58, 0xBA, 0x33, 0xD5, 0x1F, 0x08, 0x86, 0xE2, 0x06, 0x00, 0xEB, 0x60, 0x04, 0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x6A, 0x7F, 0x00, 0x6A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00,
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_03[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x80, 0x01,
        0x80,
        0x5E, 0x4F, 0x04, 0x00, 0x00, 0x00, 0x00, 0x24, 0xC2, 0xD3, 0xA4, 0x06, 0xDA, 0xF1, 0xA2, 0x65, 0x79, 0x61, 0x41, 0x00, 0x8A, 0x98, 0x36, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x79, 0x1F, 0x0F, 0x72, 0xFF, 0x2C, 0xF5, 0x32, 0x8A, 0x98, 0x36, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x1C, 0xFE, 0xF8, 0x07, 0x00, 0x70, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x04, 0x00,
    };
    const uint8_t UCI_RadioCfg_Flash_Seq[] =
    {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00,0x03,
        kSR040_RadioCrc_Finish,
        0xB7, 0x8F
    };
    /* clang-format on */
    if (!force_update) {
        uint16_t gotCrc = 0;
        status          = UwbApi_RadioConfigGetCrc(current_idx, &gotCrc);
        if (status == UWBAPI_STATUS_OK) {
            if (gotCrc == expectedCrc) {
                /* Same radio configs, so skip */
                goto exit;
            }
        }
    }
restart:
    status =
        UwbApi_SendRawCommand((uint8_t *)&UCI_RadioCfg_Init_Seq[0], sizeof(UCI_RadioCfg_Init_Seq), respBuf, &respLen);
    if (status == UWBAPI_STATUS_HPD_WAKEUP) {
        goto restart;
    }
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_00[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_00), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_01[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_01), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_02[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_02), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_03[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_03), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status =
        UwbApi_SendRawCommand((uint8_t *)&UCI_RadioCfg_Flash_Seq[0], sizeof(UCI_RadioCfg_Flash_Seq), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }

exit:
    // Exit code comes here
    return status;
}

// Rx_SP1_BPRF_Prmbl64_Sfd2_Sts64_1_Data6M8 :  #End

// Rx_SP0_hprf_Prmbl32_Sfd2_Sts0_Data6M8 :  #Start

static tUWBAPI_STATUS RadioConfig_Rx_SP0_hprf_Prmbl32_Sfd2_Sts0_Data6M8_0x04(bool force_update)
{
    tUWBAPI_STATUS status;
    uint16_t respLen = 0x05;
    uint8_t respBuf[5];
    const uint8_t current_idx  = SR040_RADIO_CFG_IDX_0x04_IDX;
    const uint16_t expectedCrc = SR040_RADIO_CFG_IDX_0x04_CRC;
    /* clang-format off */
    const uint8_t UCI_RadioCfg_Init_Seq[] =
    {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00,0x02,
        kSR040_RadioCrc_InitDownload,
        SR040_RADIO_CFG_IDX_0x04_IDX /* index */
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_00[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x00, 0x00,
        0x80,
        0x01, 0x00, 0x00, 0x00, 0x88, 0x13, 0x00, 0x05, 0x10, 0x14, 0x74, 0x00, 0x01, 0x00, 0x00, 0x00, 0xFF, 0x7F, 0x00, 0x80, 0x00, 0x00, 0x56, 0x45, 0x04, 0x7C, 0x1C, 0x40, 0x02, 0x05, 0x35, 0x04, 0x7E, 0x00, 0x00, 0x00, 0x8F, 0x98, 0x19, 0x00, 0x04, 0x70, 0x00, 0x00, 0x10, 0x10, 0x14, 0x0C, 0xC4, 0x00, 0x06, 0x00, 0x08, 0x26, 0x54, 0x00, 0x04, 0x0C, 0x04, 0x04, 0x1C, 0x07, 0x04, 0x1C, 0x07, 0x03, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5A, 0x02, 0x01, 0x00, 0x1E, 0x03, 0x1E, 0x03, 0x00, 0x03, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x07, 0x00, 0xFF, 0x03, 0xFF, 0x03, 0x00, 0x2E, 0x03, 0x00, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x50, 0x03, 0x60, 0x08, 0x01, 0x02, 0x00, 0x03, 0x04, 0x05, 0x05, 0x05, 0x38, 0x04, 0x0A, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00,
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_01[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x80, 0x00,
        0x80,
        0x05, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x0F, 0x07, 0x01, 0x02, 0x00, 0x00, 0x08, 0x08, 0x0F, 0x0F, 0x05, 0x07, 0x00, 0x05, 0x00, 0x09, 0x00, 0x19, 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, 0x01, 0x02, 0x08, 0x08, 0x08, 0x08, 0x02, 0x03, 0x05, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x18, 0x02, 0x08, 0x07, 0x98, 0x17, 0x00, 0x00, 0x00, 0x00, 0x33, 0x0A, 0x00, 0x00, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x6F, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, 0x04, 0x04, 0x00, 0xFE, 0x21, 0x00, 0x00, 0x00, 0x4E, 0x04, 0x00, 0x26, 0x8C, 0x01, 0x19, 0x05, 0x01,
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_02[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x00, 0x01,
        0x80,
        0xFF, 0xFF, 0x23, 0x00, 0x00, 0x30, 0x18, 0x00, 0x0A, 0x02, 0x01, 0x00, 0x4A, 0x01, 0x30, 0x00, 0x01, 0x2F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0xD8, 0x42, 0x67, 0x20, 0x61, 0x06, 0x8C, 0x4D, 0xAF, 0x62, 0x0A, 0x00, 0x00, 0x00, 0x00, 0xA0, 0xFF, 0xFF, 0xFF, 0xFF, 0xF3, 0xEE, 0xFF, 0xED, 0xEF, 0xF7, 0x7F, 0x06, 0x00, 0x97, 0x3C, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x7F, 0x7F, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00,
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_03[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x80, 0x01,
        0x80,
        0x5E, 0x4F, 0x08, 0x00, 0x00, 0x00, 0x00, 0x12, 0xC2, 0xD3, 0xA4, 0x06, 0xDA, 0xF1, 0xA2, 0x65, 0x79, 0x61, 0x41, 0x00, 0x8A, 0x98, 0x36, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x79, 0x1F, 0x0F, 0x72, 0xFF, 0x2C, 0xF5, 0x32, 0x8A, 0x98, 0x36, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x1C, 0xFE, 0xF8, 0x07, 0x00, 0x70, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x04, 0x00,
    };
    const uint8_t UCI_RadioCfg_Flash_Seq[] =
    {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00,0x03,
        kSR040_RadioCrc_Finish,
        0x62, 0x4E
    };
    /* clang-format on */
    if (!force_update) {
        uint16_t gotCrc = 0;
        status          = UwbApi_RadioConfigGetCrc(current_idx, &gotCrc);
        if (status == UWBAPI_STATUS_OK) {
            if (gotCrc == expectedCrc) {
                /* Same radio configs, so skip */
                goto exit;
            }
        }
    }
restart:
    status =
        UwbApi_SendRawCommand((uint8_t *)&UCI_RadioCfg_Init_Seq[0], sizeof(UCI_RadioCfg_Init_Seq), respBuf, &respLen);
    if (status == UWBAPI_STATUS_HPD_WAKEUP) {
        goto restart;
    }
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_00[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_00), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_01[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_01), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_02[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_02), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_03[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_03), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status =
        UwbApi_SendRawCommand((uint8_t *)&UCI_RadioCfg_Flash_Seq[0], sizeof(UCI_RadioCfg_Flash_Seq), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }

exit:
    // Exit code comes here
    return status;
}

// Rx_SP0_hprf_Prmbl32_Sfd2_Sts0_Data6M8 :  #End

// Rx_SP0_hprf_Prmbl32_Sfd2_Sts0_Data7M8 :  #Start

static tUWBAPI_STATUS RadioConfig_Rx_SP0_hprf_Prmbl32_Sfd2_Sts0_Data7M8_0x05(bool force_update)
{
    tUWBAPI_STATUS status;
    uint16_t respLen = 0x05;
    uint8_t respBuf[5];
    const uint8_t current_idx  = SR040_RADIO_CFG_IDX_0x05_IDX;
    const uint16_t expectedCrc = SR040_RADIO_CFG_IDX_0x05_CRC;
    /* clang-format off */
    const uint8_t UCI_RadioCfg_Init_Seq[] =
    {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00,0x02,
        kSR040_RadioCrc_InitDownload,
        SR040_RADIO_CFG_IDX_0x05_IDX /* index */
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_00[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x00, 0x00,
        0x80,
        0x01, 0x00, 0x00, 0x00, 0x88, 0x13, 0x00, 0x05, 0x10, 0x14, 0x74, 0x00, 0x01, 0x00, 0x00, 0x00, 0xFF, 0x7F, 0x00, 0x80, 0x00, 0x00, 0x56, 0x45, 0x04, 0x7C, 0x1C, 0x40, 0x02, 0x05, 0x35, 0x04, 0x7E, 0x00, 0x00, 0x00, 0x8F, 0x98, 0x19, 0x00, 0x04, 0x70, 0x00, 0x00, 0x10, 0x10, 0x14, 0x0C, 0xC4, 0x00, 0x06, 0x00, 0x08, 0x26, 0x54, 0x00, 0x04, 0x0C, 0x04, 0x04, 0x1C, 0x07, 0x04, 0x1C, 0x07, 0x03, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5A, 0x02, 0x01, 0x00, 0x1E, 0x03, 0x1E, 0x03, 0x00, 0x03, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x07, 0x00, 0xFF, 0x03, 0xFF, 0x03, 0x00, 0x2E, 0x03, 0x00, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x50, 0x03, 0x60, 0x08, 0x01, 0x02, 0x00, 0x03, 0x04, 0x05, 0x05, 0x05, 0x38, 0x04, 0x0A, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00,
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_01[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x80, 0x00,
        0x80,
        0x05, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x0F, 0x07, 0x01, 0x02, 0x00, 0x00, 0x08, 0x08, 0x0F, 0x0F, 0x05, 0x07, 0x00, 0x05, 0x00, 0x09, 0x00, 0x19, 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, 0x01, 0x02, 0x08, 0x08, 0x08, 0x08, 0x02, 0x03, 0x05, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x18, 0x02, 0x08, 0x07, 0x98, 0x17, 0x00, 0x00, 0x00, 0x00, 0x33, 0x0A, 0x00, 0x00, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x04, 0x04, 0x00, 0xFE, 0x21, 0x00, 0x00, 0x00, 0x32, 0x04, 0x00, 0x26, 0x0C, 0x01, 0x19, 0x05, 0x01,
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_02[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x00, 0x01,
        0x80,
        0xFF, 0xFF, 0x23, 0x00, 0x01, 0x30, 0x38, 0x00, 0x0A, 0x02, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00, 0x01, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0xD8, 0x42, 0x67, 0x20, 0x61, 0x06, 0x8C, 0x4D, 0xAF, 0x62, 0x0A, 0x00, 0x00, 0x00, 0x00, 0xA0, 0xFF, 0xFF, 0xFF, 0xFF, 0xF3, 0xEE, 0xFF, 0xED, 0xEF, 0xF7, 0x7F, 0x06, 0x00, 0x97, 0x3C, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x7F, 0x7F, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00,
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_03[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x80, 0x01,
        0x80,
        0x5E, 0x4F, 0x08, 0x00, 0x00, 0x00, 0x00, 0x12, 0xC2, 0xD3, 0xA4, 0x06, 0xDA, 0xF1, 0xA2, 0x65, 0x79, 0x61, 0x41, 0x00, 0x8A, 0x98, 0x36, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x79, 0x1F, 0x0F, 0x72, 0xFF, 0x2C, 0xF5, 0x32, 0x8A, 0x98, 0x36, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x1C, 0xFE, 0xF8, 0x07, 0x00, 0x70, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x04, 0x00,
    };
    const uint8_t UCI_RadioCfg_Flash_Seq[] =
    {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00,0x03,
        kSR040_RadioCrc_Finish,
        0xA8, 0x73
    };
    /* clang-format on */
    if (!force_update) {
        uint16_t gotCrc = 0;
        status          = UwbApi_RadioConfigGetCrc(current_idx, &gotCrc);
        if (status == UWBAPI_STATUS_OK) {
            if (gotCrc == expectedCrc) {
                /* Same radio configs, so skip */
                goto exit;
            }
        }
    }
restart:
    status =
        UwbApi_SendRawCommand((uint8_t *)&UCI_RadioCfg_Init_Seq[0], sizeof(UCI_RadioCfg_Init_Seq), respBuf, &respLen);
    if (status == UWBAPI_STATUS_HPD_WAKEUP) {
        goto restart;
    }
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_00[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_00), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_01[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_01), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_02[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_02), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_03[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_03), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status =
        UwbApi_SendRawCommand((uint8_t *)&UCI_RadioCfg_Flash_Seq[0], sizeof(UCI_RadioCfg_Flash_Seq), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }

exit:
    // Exit code comes here
    return status;
}

// Rx_SP0_hprf_Prmbl32_Sfd2_Sts0_Data7M8 :  #End

// Rx_SP0_hprf_Prmbl64_Sfd2_Sts0_Data6M8 :  #Start

static tUWBAPI_STATUS RadioConfig_Rx_SP0_hprf_Prmbl64_Sfd2_Sts0_Data6M8_0x06(bool force_update)
{
    tUWBAPI_STATUS status;
    uint16_t respLen = 0x05;
    uint8_t respBuf[5];
    const uint8_t current_idx  = SR040_RADIO_CFG_IDX_0x06_IDX;
    const uint16_t expectedCrc = SR040_RADIO_CFG_IDX_0x06_CRC;
    /* clang-format off */
    const uint8_t UCI_RadioCfg_Init_Seq[] =
    {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00,0x02,
        kSR040_RadioCrc_InitDownload,
        SR040_RADIO_CFG_IDX_0x06_IDX /* index */
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_00[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x00, 0x00,
        0x80,
        0x01, 0x00, 0x00, 0x00, 0x88, 0x13, 0x00, 0x05, 0x10, 0x14, 0x74, 0x00, 0x01, 0x00, 0x00, 0x00, 0xFF, 0x7F, 0x00, 0x80, 0x00, 0x00, 0x56, 0x45, 0x04, 0x7C, 0x1C, 0x40, 0x02, 0x05, 0x35, 0x04, 0x7E, 0x00, 0x00, 0x00, 0x8F, 0x98, 0x19, 0x00, 0x04, 0x70, 0x00, 0x00, 0x10, 0x10, 0x14, 0x0C, 0xC4, 0x00, 0x06, 0x00, 0x08, 0x26, 0x54, 0x00, 0x04, 0x0C, 0x04, 0x04, 0x1C, 0x07, 0x04, 0x1C, 0x07, 0x03, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5A, 0x03, 0x02, 0x00, 0x08, 0x02, 0x08, 0x02, 0x00, 0x03, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0x00, 0x0F, 0x00, 0xFF, 0x03, 0xFF, 0x03, 0x00, 0x2E, 0x03, 0x00, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x50, 0x03, 0x60, 0x08, 0x01, 0x02, 0x00, 0x03, 0x04, 0x05, 0x05, 0x05, 0x38, 0x04, 0x0A, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00,
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_01[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x80, 0x00,
        0x80,
        0x09, 0x00, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x0F, 0x07, 0x01, 0x02, 0x00, 0x00, 0x08, 0x08, 0x0F, 0x0F, 0x05, 0x07, 0x00, 0x09, 0x00, 0x11, 0x00, 0x31, 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x01, 0x01, 0x02, 0x03, 0x08, 0x08, 0x08, 0x08, 0x04, 0x05, 0x07, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x18, 0x02, 0x08, 0x07, 0x98, 0x17, 0x00, 0x00, 0x00, 0x00, 0x33, 0x0A, 0x00, 0x00, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x6F, 0x00, 0x00, 0x00, 0x53, 0x00, 0x01, 0x05, 0x05, 0x00, 0xFE, 0x21, 0x00, 0x00, 0x00, 0x4E, 0x04, 0x00, 0x26, 0x8C, 0x01, 0x19, 0x05, 0x01,
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_02[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x00, 0x01,
        0x80,
        0xFF, 0xFF, 0x3F, 0x00, 0x00, 0x30, 0x18, 0x00, 0x0A, 0x02, 0x01, 0x00, 0x4A, 0x01, 0x30, 0x00, 0x01, 0x2F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0xD8, 0x42, 0x67, 0x20, 0x61, 0x06, 0x8C, 0x4D, 0xAF, 0x62, 0x0A, 0x00, 0x00, 0x00, 0x00, 0xA0, 0xFF, 0xFF, 0xFF, 0xFF, 0xF3, 0xEE, 0xFF, 0xED, 0xEF, 0xF7, 0x7F, 0x06, 0x00, 0x97, 0x3C, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x7F, 0x7F, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00,
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_03[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x80, 0x01,
        0x80,
        0x5E, 0x4F, 0x08, 0x00, 0x00, 0x00, 0x00, 0x12, 0xC2, 0xD3, 0xA4, 0x06, 0xDA, 0xF1, 0xA2, 0x65, 0x79, 0x61, 0x41, 0x00, 0x8A, 0x98, 0x36, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x79, 0x1F, 0x0F, 0x72, 0xFF, 0x2C, 0xF5, 0x32, 0x8A, 0x98, 0x36, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x1C, 0xFE, 0xF8, 0x07, 0x00, 0x30, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x04, 0x00,
    };
    const uint8_t UCI_RadioCfg_Flash_Seq[] =
    {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00,0x03,
        kSR040_RadioCrc_Finish,
        0x08, 0x5F
    };
    /* clang-format on */
    if (!force_update) {
        uint16_t gotCrc = 0;
        status          = UwbApi_RadioConfigGetCrc(current_idx, &gotCrc);
        if (status == UWBAPI_STATUS_OK) {
            if (gotCrc == expectedCrc) {
                /* Same radio configs, so skip */
                goto exit;
            }
        }
    }
restart:
    status =
        UwbApi_SendRawCommand((uint8_t *)&UCI_RadioCfg_Init_Seq[0], sizeof(UCI_RadioCfg_Init_Seq), respBuf, &respLen);
    if (status == UWBAPI_STATUS_HPD_WAKEUP) {
        goto restart;
    }
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_00[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_00), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_01[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_01), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_02[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_02), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_03[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_03), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status =
        UwbApi_SendRawCommand((uint8_t *)&UCI_RadioCfg_Flash_Seq[0], sizeof(UCI_RadioCfg_Flash_Seq), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }

exit:
    // Exit code comes here
    return status;
}

// Rx_SP0_hprf_Prmbl64_Sfd2_Sts0_Data6M8 :  #End

// Rx_SP0_hprf_Prmbl64_Sfd2_Sts0_Data7M8 :  #Start

static tUWBAPI_STATUS RadioConfig_Rx_SP0_hprf_Prmbl64_Sfd2_Sts0_Data7M8_0x07(bool force_update)
{
    tUWBAPI_STATUS status;
    uint16_t respLen = 0x05;
    uint8_t respBuf[5];
    const uint8_t current_idx  = SR040_RADIO_CFG_IDX_0x07_IDX;
    const uint16_t expectedCrc = SR040_RADIO_CFG_IDX_0x07_CRC;
    /* clang-format off */
    const uint8_t UCI_RadioCfg_Init_Seq[] =
    {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00,0x02,
        kSR040_RadioCrc_InitDownload,
        SR040_RADIO_CFG_IDX_0x07_IDX /* index */
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_00[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x00, 0x00,
        0x80,
        0x01, 0x00, 0x00, 0x00, 0x88, 0x13, 0x00, 0x05, 0x10, 0x14, 0x74, 0x00, 0x01, 0x00, 0x00, 0x00, 0xFF, 0x7F, 0x00, 0x80, 0x00, 0x00, 0x56, 0x45, 0x04, 0x7C, 0x1C, 0x40, 0x02, 0x05, 0x35, 0x04, 0x7E, 0x00, 0x00, 0x00, 0x8F, 0x98, 0x19, 0x00, 0x04, 0x70, 0x00, 0x00, 0x10, 0x10, 0x14, 0x0C, 0xC4, 0x00, 0x06, 0x00, 0x08, 0x26, 0x54, 0x00, 0x04, 0x0C, 0x04, 0x04, 0x1C, 0x07, 0x04, 0x1C, 0x07, 0x03, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5A, 0x03, 0x02, 0x00, 0x08, 0x02, 0x08, 0x02, 0x00, 0x03, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0x00, 0x0F, 0x00, 0xFF, 0x03, 0xFF, 0x03, 0x00, 0x2E, 0x03, 0x00, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x50, 0x03, 0x60, 0x08, 0x01, 0x02, 0x00, 0x03, 0x04, 0x05, 0x05, 0x05, 0x38, 0x04, 0x0A, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00,
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_01[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x80, 0x00,
        0x80,
        0x09, 0x00, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x0F, 0x07, 0x01, 0x02, 0x00, 0x00, 0x08, 0x08, 0x0F, 0x0F, 0x05, 0x07, 0x00, 0x09, 0x00, 0x11, 0x00, 0x31, 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x01, 0x01, 0x02, 0x03, 0x08, 0x08, 0x08, 0x08, 0x04, 0x05, 0x07, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x18, 0x02, 0x08, 0x07, 0x98, 0x17, 0x00, 0x00, 0x00, 0x00, 0x33, 0x0A, 0x00, 0x00, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x31, 0x00, 0x01, 0x05, 0x05, 0x00, 0xFE, 0x21, 0x00, 0x00, 0x00, 0x32, 0x04, 0x00, 0x26, 0x0C, 0x01, 0x19, 0x05, 0x01,
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_02[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x00, 0x01,
        0x80,
        0xFF, 0xFF, 0x3F, 0x00, 0x01, 0x30, 0x38, 0x00, 0x0A, 0x02, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00, 0x01, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0xD8, 0x42, 0x67, 0x20, 0x61, 0x06, 0x8C, 0x4D, 0xAF, 0x62, 0x0A, 0x00, 0x00, 0x00, 0x00, 0xA0, 0xFF, 0xFF, 0xFF, 0xFF, 0xF3, 0xEE, 0xFF, 0xED, 0xEF, 0xF7, 0x7F, 0x06, 0x00, 0x97, 0x3C, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x7F, 0x7F, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00,
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_03[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x80, 0x01,
        0x80,
        0x5E, 0x4F, 0x08, 0x00, 0x00, 0x00, 0x00, 0x12, 0xC2, 0xD3, 0xA4, 0x06, 0xDA, 0xF1, 0xA2, 0x65, 0x79, 0x61, 0x41, 0x00, 0x8A, 0x98, 0x36, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x79, 0x1F, 0x0F, 0x72, 0xFF, 0x2C, 0xF5, 0x32, 0x8A, 0x98, 0x36, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x1C, 0xFE, 0xF8, 0x07, 0x00, 0x30, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x04, 0x00,
    };
    const uint8_t UCI_RadioCfg_Flash_Seq[] =
    {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00,0x03,
        kSR040_RadioCrc_Finish,
        0xC2, 0x62
    };
    /* clang-format on */
    if (!force_update) {
        uint16_t gotCrc = 0;
        status          = UwbApi_RadioConfigGetCrc(current_idx, &gotCrc);
        if (status == UWBAPI_STATUS_OK) {
            if (gotCrc == expectedCrc) {
                /* Same radio configs, so skip */
                goto exit;
            }
        }
    }
restart:
    status =
        UwbApi_SendRawCommand((uint8_t *)&UCI_RadioCfg_Init_Seq[0], sizeof(UCI_RadioCfg_Init_Seq), respBuf, &respLen);
    if (status == UWBAPI_STATUS_HPD_WAKEUP) {
        goto restart;
    }
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_00[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_00), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_01[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_01), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_02[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_02), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_03[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_03), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status =
        UwbApi_SendRawCommand((uint8_t *)&UCI_RadioCfg_Flash_Seq[0], sizeof(UCI_RadioCfg_Flash_Seq), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }

exit:
    // Exit code comes here
    return status;
}

// Rx_SP0_hprf_Prmbl64_Sfd2_Sts0_Data7M8 :  #End

// Rx_SP1_hprf_Prmbl32_Sfd2_Sts64_1_Data6M8 :  #Start

static tUWBAPI_STATUS RadioConfig_Rx_SP1_hprf_Prmbl32_Sfd2_Sts64_1_Data6M8_0x08(bool force_update)
{
    tUWBAPI_STATUS status;
    uint16_t respLen = 0x05;
    uint8_t respBuf[5];
    const uint8_t current_idx  = SR040_RADIO_CFG_IDX_0x08_IDX;
    const uint16_t expectedCrc = SR040_RADIO_CFG_IDX_0x08_CRC;
    /* clang-format off */
    const uint8_t UCI_RadioCfg_Init_Seq[] =
    {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00,0x02,
        kSR040_RadioCrc_InitDownload,
        SR040_RADIO_CFG_IDX_0x08_IDX /* index */
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_00[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x00, 0x00,
        0x80,
        0x01, 0x00, 0x00, 0x00, 0x88, 0x13, 0x00, 0x05, 0x10, 0x14, 0x74, 0x00, 0x01, 0x00, 0x00, 0x00, 0xFF, 0x7F, 0x00, 0x80, 0x00, 0x00, 0x56, 0x45, 0x04, 0x7C, 0x1C, 0x40, 0x02, 0x05, 0x35, 0x04, 0x7E, 0x00, 0x00, 0x00, 0x8F, 0x98, 0x19, 0x00, 0x04, 0x70, 0x00, 0x00, 0x10, 0x10, 0x14, 0x0C, 0xC4, 0x00, 0x06, 0x00, 0x08, 0x26, 0x54, 0x00, 0x04, 0x0C, 0x04, 0x04, 0x1C, 0x07, 0x04, 0x1C, 0x07, 0x03, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5A, 0x02, 0x01, 0x00, 0x1E, 0x03, 0x1E, 0x03, 0x00, 0x03, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x07, 0x00, 0x3F, 0x00, 0xFF, 0x03, 0x00, 0x2E, 0x03, 0x00, 0x30, 0x01, 0x08, 0x00, 0x30, 0x01, 0x50, 0x03, 0x60, 0x08, 0x01, 0x02, 0x00, 0x03, 0x04, 0x05, 0x06, 0x05, 0x38, 0x04, 0x0A, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00,
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_01[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x80, 0x00,
        0x80,
        0x05, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x0F, 0x07, 0x01, 0x02, 0x00, 0x00, 0x08, 0x08, 0x0F, 0x0F, 0x05, 0x07, 0x00, 0x05, 0x00, 0x09, 0x00, 0x19, 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, 0x01, 0x02, 0x08, 0x08, 0x08, 0x08, 0x02, 0x03, 0x05, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x18, 0x02, 0x08, 0x07, 0x98, 0x17, 0x3F, 0x00, 0x00, 0x00, 0x37, 0x0A, 0x07, 0x00, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x6F, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, 0x04, 0x04, 0x00, 0xFE, 0x21, 0x00, 0x00, 0x00, 0x4E, 0x04, 0x00, 0x26, 0x8C, 0x01, 0x19, 0x05, 0x01,
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_02[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x00, 0x01,
        0x80,
        0xFF, 0xFF, 0x23, 0x00, 0x00, 0x30, 0x18, 0x00, 0x0A, 0x02, 0x01, 0x00, 0x4A, 0x01, 0x30, 0x00, 0x01, 0x2F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0xD8, 0x42, 0x67, 0x20, 0x61, 0x06, 0x8C, 0x4D, 0xAF, 0x62, 0x0A, 0x00, 0x00, 0x00, 0x00, 0xA0, 0xFF, 0xFF, 0xFF, 0xFF, 0xF3, 0xEE, 0xFF, 0xED, 0xEF, 0xF7, 0x7F, 0x06, 0x00, 0x97, 0x3C, 0x04, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x6A, 0x7F, 0x00, 0x6A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00,
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_03[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x80, 0x01,
        0x80,
        0x5E, 0x4F, 0x04, 0x00, 0x00, 0x00, 0x00, 0x12, 0xC2, 0xD3, 0xA4, 0x06, 0xDA, 0xF1, 0xA2, 0x65, 0x79, 0x61, 0x41, 0x00, 0x8A, 0x98, 0x36, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x79, 0x1F, 0x0F, 0x72, 0xFF, 0x2C, 0xF5, 0x32, 0x8A, 0x98, 0x36, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x1C, 0xFE, 0xF8, 0x07, 0x00, 0x70, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x04, 0x00,
    };
    const uint8_t UCI_RadioCfg_Flash_Seq[] =
    {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00,0x03,
        kSR040_RadioCrc_Finish,
        0x57, 0x73
    };
    /* clang-format on */
    if (!force_update) {
        uint16_t gotCrc = 0;
        status          = UwbApi_RadioConfigGetCrc(current_idx, &gotCrc);
        if (status == UWBAPI_STATUS_OK) {
            if (gotCrc == expectedCrc) {
                /* Same radio configs, so skip */
                goto exit;
            }
        }
    }
restart:
    status =
        UwbApi_SendRawCommand((uint8_t *)&UCI_RadioCfg_Init_Seq[0], sizeof(UCI_RadioCfg_Init_Seq), respBuf, &respLen);
    if (status == UWBAPI_STATUS_HPD_WAKEUP) {
        goto restart;
    }
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_00[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_00), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_01[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_01), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_02[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_02), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_03[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_03), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status =
        UwbApi_SendRawCommand((uint8_t *)&UCI_RadioCfg_Flash_Seq[0], sizeof(UCI_RadioCfg_Flash_Seq), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }

exit:
    // Exit code comes here
    return status;
}

// Rx_SP1_hprf_Prmbl32_Sfd2_Sts64_1_Data6M8 :  #End

// Rx_SP1_hprf_Prmbl64_Sfd2_Sts64_2_Data6M8 :  #Start

static tUWBAPI_STATUS RadioConfig_Rx_SP1_hprf_Prmbl64_Sfd2_Sts64_2_Data6M8_0x09(bool force_update)
{
    tUWBAPI_STATUS status;
    uint16_t respLen = 0x05;
    uint8_t respBuf[5];
    const uint8_t current_idx  = SR040_RADIO_CFG_IDX_0x09_IDX;
    const uint16_t expectedCrc = SR040_RADIO_CFG_IDX_0x09_CRC;
    /* clang-format off */
    const uint8_t UCI_RadioCfg_Init_Seq[] =
    {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00,0x02,
        kSR040_RadioCrc_InitDownload,
        SR040_RADIO_CFG_IDX_0x09_IDX /* index */
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_00[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x00, 0x00,
        0x80,
        0x01, 0x00, 0x00, 0x00, 0x88, 0x13, 0x00, 0x05, 0x10, 0x14, 0x74, 0x00, 0x01, 0x00, 0x00, 0x00, 0xFF, 0x7F, 0x00, 0x80, 0x00, 0x00, 0x56, 0x45, 0x04, 0x7C, 0x1C, 0x40, 0x02, 0x05, 0x35, 0x04, 0x7E, 0x00, 0x00, 0x00, 0x8F, 0x98, 0x19, 0x00, 0x04, 0x70, 0x00, 0x00, 0x10, 0x10, 0x14, 0x0C, 0xC4, 0x00, 0x06, 0x00, 0x08, 0x26, 0x54, 0x00, 0x04, 0x0C, 0x04, 0x04, 0x1C, 0x07, 0x04, 0x1C, 0x07, 0x03, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5A, 0x03, 0x02, 0x00, 0x08, 0x02, 0x08, 0x02, 0x00, 0x03, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0x00, 0x0F, 0x00, 0x7F, 0x00, 0xFF, 0x03, 0x00, 0x2E, 0x03, 0x00, 0x30, 0x01, 0x08, 0x00, 0x30, 0x01, 0x50, 0x03, 0x60, 0x08, 0x01, 0x02, 0x00, 0x03, 0x04, 0x05, 0x06, 0x05, 0x38, 0x04, 0x0A, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00,
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_01[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x80, 0x00,
        0x80,
        0x09, 0x00, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x0F, 0x07, 0x01, 0x02, 0x00, 0x00, 0x08, 0x08, 0x0F, 0x0F, 0x05, 0x07, 0x00, 0x09, 0x00, 0x11, 0x00, 0x31, 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x01, 0x01, 0x02, 0x03, 0x08, 0x08, 0x08, 0x08, 0x04, 0x05, 0x07, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x18, 0x02, 0x08, 0x07, 0x98, 0x17, 0x3F, 0x00, 0x00, 0x00, 0x37, 0x0A, 0x07, 0x00, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x6F, 0x00, 0x00, 0x01, 0x53, 0x00, 0x01, 0x05, 0x05, 0x00, 0xFE, 0x21, 0x00, 0x00, 0x00, 0x4E, 0x04, 0x00, 0x26, 0x8C, 0x01, 0x19, 0x05, 0x01,
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_02[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x00, 0x01,
        0x80,
        0xFF, 0xFF, 0x3F, 0x00, 0x00, 0x30, 0x10, 0x00, 0x0A, 0x02, 0x01, 0x00, 0x4A, 0x01, 0x30, 0x00, 0x01, 0x2F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0xD8, 0x42, 0x67, 0x20, 0x61, 0x06, 0x8C, 0x4D, 0xAF, 0x62, 0x0A, 0x00, 0x00, 0x00, 0x00, 0xA0, 0xFF, 0xFF, 0xFF, 0xFF, 0xF3, 0xEE, 0xFF, 0xED, 0xEF, 0xF7, 0x7F, 0x06, 0x00, 0x97, 0x3C, 0x04, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x6A, 0x7F, 0x00, 0x6A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00,
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_03[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x80, 0x01,
        0x80,
        0x5E, 0x4F, 0x04, 0x00, 0x00, 0x00, 0x00, 0x08, 0xC2, 0xD3, 0xA4, 0x06, 0xDA, 0xF1, 0xA2, 0x65, 0x79, 0x61, 0x41, 0x00, 0x8A, 0x98, 0x36, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x79, 0x1F, 0x0F, 0x72, 0xFF, 0x2C, 0xF5, 0x32, 0x8A, 0x98, 0x36, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x1C, 0xFE, 0xF8, 0x07, 0x00, 0x30, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2B, 0xF4, 0x00,
    };
    const uint8_t UCI_RadioCfg_Flash_Seq[] =
    {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00,0x03,
        kSR040_RadioCrc_Finish,
        0x58, 0x89
    };
    /* clang-format on */
    if (!force_update) {
        uint16_t gotCrc = 0;
        status          = UwbApi_RadioConfigGetCrc(current_idx, &gotCrc);
        if (status == UWBAPI_STATUS_OK) {
            if (gotCrc == expectedCrc) {
                /* Same radio configs, so skip */
                goto exit;
            }
        }
    }
restart:
    status =
        UwbApi_SendRawCommand((uint8_t *)&UCI_RadioCfg_Init_Seq[0], sizeof(UCI_RadioCfg_Init_Seq), respBuf, &respLen);
    if (status == UWBAPI_STATUS_HPD_WAKEUP) {
        goto restart;
    }
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_00[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_00), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_01[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_01), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_02[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_02), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_03[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_03), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status =
        UwbApi_SendRawCommand((uint8_t *)&UCI_RadioCfg_Flash_Seq[0], sizeof(UCI_RadioCfg_Flash_Seq), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }

exit:
    // Exit code comes here
    return status;
}

// Rx_SP1_hprf_Prmbl64_Sfd2_Sts64_2_Data6M8 :  #End

// Rx_SP1_hprf_Prmbl64_Sfd2_Sts64_1_Data6M8 :  #Start

static tUWBAPI_STATUS RadioConfig_Rx_SP1_hprf_Prmbl64_Sfd2_Sts64_1_Data6M8_0x0A(bool force_update)
{
    tUWBAPI_STATUS status;
    uint16_t respLen = 0x05;
    uint8_t respBuf[5];
    const uint8_t current_idx  = SR040_RADIO_CFG_IDX_0x0A_IDX;
    const uint16_t expectedCrc = SR040_RADIO_CFG_IDX_0x0A_CRC;
    /* clang-format off */
    const uint8_t UCI_RadioCfg_Init_Seq[] =
    {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00,0x02,
        kSR040_RadioCrc_InitDownload,
        SR040_RADIO_CFG_IDX_0x0A_IDX /* index */
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_00[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x00, 0x00,
        0x80,
        0x01, 0x00, 0x00, 0x00, 0x88, 0x13, 0x00, 0x05, 0x10, 0x14, 0x74, 0x00, 0x01, 0x00, 0x00, 0x00, 0xFF, 0x7F, 0x00, 0x80, 0x00, 0x00, 0x56, 0x45, 0x04, 0x7C, 0x1C, 0x40, 0x02, 0x05, 0x35, 0x04, 0x7E, 0x00, 0x00, 0x00, 0x8F, 0x98, 0x19, 0x00, 0x04, 0x70, 0x00, 0x00, 0x10, 0x10, 0x14, 0x0C, 0xC4, 0x00, 0x06, 0x00, 0x08, 0x26, 0x54, 0x00, 0x04, 0x0C, 0x04, 0x04, 0x1C, 0x07, 0x04, 0x1C, 0x07, 0x03, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5A, 0x03, 0x02, 0x00, 0x08, 0x02, 0x08, 0x02, 0x00, 0x03, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0x00, 0x0F, 0x00, 0x3F, 0x00, 0xFF, 0x03, 0x00, 0x2E, 0x03, 0x00, 0x30, 0x01, 0x08, 0x00, 0x30, 0x01, 0x50, 0x03, 0x60, 0x08, 0x01, 0x02, 0x00, 0x03, 0x04, 0x05, 0x06, 0x05, 0x38, 0x04, 0x0A, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00,
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_01[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x80, 0x00,
        0x80,
        0x09, 0x00, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x0F, 0x07, 0x01, 0x02, 0x00, 0x00, 0x08, 0x08, 0x0F, 0x0F, 0x05, 0x07, 0x00, 0x09, 0x00, 0x11, 0x00, 0x31, 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x01, 0x01, 0x02, 0x03, 0x08, 0x08, 0x08, 0x08, 0x04, 0x05, 0x07, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x18, 0x02, 0x08, 0x07, 0x98, 0x17, 0x3F, 0x00, 0x00, 0x00, 0x37, 0x0A, 0x07, 0x00, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x6F, 0x00, 0x00, 0x00, 0x53, 0x00, 0x01, 0x05, 0x05, 0x00, 0xFE, 0x21, 0x00, 0x00, 0x00, 0x4E, 0x04, 0x00, 0x26, 0x8C, 0x01, 0x19, 0x05, 0x01,
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_02[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x00, 0x01,
        0x80,
        0xFF, 0xFF, 0x3F, 0x00, 0x00, 0x30, 0x18, 0x00, 0x0A, 0x02, 0x01, 0x00, 0x4A, 0x01, 0x30, 0x00, 0x01, 0x2F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0xD8, 0x42, 0x67, 0x20, 0x61, 0x06, 0x8C, 0x4D, 0xAF, 0x62, 0x0A, 0x00, 0x00, 0x00, 0x00, 0xA0, 0xFF, 0xFF, 0xFF, 0xFF, 0xF3, 0xEE, 0xFF, 0xED, 0xEF, 0xF7, 0x7F, 0x06, 0x00, 0x97, 0x3C, 0x04, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x6A, 0x7F, 0x00, 0x6A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00,
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_03[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x80, 0x01,
        0x80,
        0x5E, 0x4F, 0x04, 0x00, 0x00, 0x00, 0x00, 0x12, 0xC2, 0xD3, 0xA4, 0x06, 0xDA, 0xF1, 0xA2, 0x65, 0x79, 0x61, 0x41, 0x00, 0x8A, 0x98, 0x36, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x79, 0x1F, 0x0F, 0x72, 0xFF, 0x2C, 0xF5, 0x32, 0x8A, 0x98, 0x36, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x1C, 0xFE, 0xF8, 0x07, 0x00, 0x30, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x04, 0x00,
    };
    const uint8_t UCI_RadioCfg_Flash_Seq[] =
    {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00,0x03,
        kSR040_RadioCrc_Finish,
        0x3D, 0x62
    };
    /* clang-format on */
    if (!force_update) {
        uint16_t gotCrc = 0;
        status          = UwbApi_RadioConfigGetCrc(current_idx, &gotCrc);
        if (status == UWBAPI_STATUS_OK) {
            if (gotCrc == expectedCrc) {
                /* Same radio configs, so skip */
                goto exit;
            }
        }
    }
restart:
    status =
        UwbApi_SendRawCommand((uint8_t *)&UCI_RadioCfg_Init_Seq[0], sizeof(UCI_RadioCfg_Init_Seq), respBuf, &respLen);
    if (status == UWBAPI_STATUS_HPD_WAKEUP) {
        goto restart;
    }
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_00[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_00), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_01[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_01), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_02[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_02), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_03[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_03), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status =
        UwbApi_SendRawCommand((uint8_t *)&UCI_RadioCfg_Flash_Seq[0], sizeof(UCI_RadioCfg_Flash_Seq), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }

exit:
    // Exit code comes here
    return status;
}

// Rx_SP1_hprf_Prmbl64_Sfd2_Sts64_1_Data6M8 :  #End

// Rx_Empty_512_0x0B :  #Start

static tUWBAPI_STATUS RadioConfig_Rx_Empty_512_0x0B_0x0B(bool force_update)
{
    tUWBAPI_STATUS status;
    uint16_t respLen = 0x05;
    uint8_t respBuf[5];
    const uint8_t current_idx  = SR040_RADIO_CFG_IDX_0x0B_IDX;
    const uint16_t expectedCrc = SR040_RADIO_CFG_IDX_0x0B_CRC;
    /* clang-format off */
    const uint8_t UCI_RadioCfg_Init_Seq[] =
    {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00,0x02,
        kSR040_RadioCrc_InitDownload,
        SR040_RADIO_CFG_IDX_0x0B_IDX /* index */
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_00[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x00, 0x00,
        0x80,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_01[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x80, 0x00,
        0x80,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_02[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x00, 0x01,
        0x80,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_03[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x80, 0x01,
        0x80,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    };
    const uint8_t UCI_RadioCfg_Flash_Seq[] =
    {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00,0x03,
        kSR040_RadioCrc_Finish,
        0x00, 0x00
    };
    /* clang-format on */
    if (!force_update) {
        uint16_t gotCrc = 0;
        status          = UwbApi_RadioConfigGetCrc(current_idx, &gotCrc);
        if (status == UWBAPI_STATUS_OK) {
            if (gotCrc == expectedCrc) {
                /* Same radio configs, so skip */
                goto exit;
            }
        }
    }
restart:
    status =
        UwbApi_SendRawCommand((uint8_t *)&UCI_RadioCfg_Init_Seq[0], sizeof(UCI_RadioCfg_Init_Seq), respBuf, &respLen);
    if (status == UWBAPI_STATUS_HPD_WAKEUP) {
        goto restart;
    }
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_00[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_00), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_01[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_01), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_02[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_02), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_03[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_03), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status =
        UwbApi_SendRawCommand((uint8_t *)&UCI_RadioCfg_Flash_Seq[0], sizeof(UCI_RadioCfg_Flash_Seq), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }

exit:
    // Exit code comes here
    return status;
}

// Rx_Empty_512_0x0B :  #End

// Rx_Empty_512_0x0C :  #Start

static tUWBAPI_STATUS RadioConfig_Rx_Empty_512_0x0C_0x0C(bool force_update)
{
    tUWBAPI_STATUS status;
    uint16_t respLen = 0x05;
    uint8_t respBuf[5];
    const uint8_t current_idx  = SR040_RADIO_CFG_IDX_0x0C_IDX;
    const uint16_t expectedCrc = SR040_RADIO_CFG_IDX_0x0C_CRC;
    /* clang-format off */
    const uint8_t UCI_RadioCfg_Init_Seq[] =
    {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00,0x02,
        kSR040_RadioCrc_InitDownload,
        SR040_RADIO_CFG_IDX_0x0C_IDX /* index */
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_00[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x00, 0x00,
        0x80,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_01[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x80, 0x00,
        0x80,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_02[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x00, 0x01,
        0x80,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_03[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x80, 0x01,
        0x80,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    };
    const uint8_t UCI_RadioCfg_Flash_Seq[] =
    {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00,0x03,
        kSR040_RadioCrc_Finish,
        0x00, 0x00
    };
    /* clang-format on */
    if (!force_update) {
        uint16_t gotCrc = 0;
        status          = UwbApi_RadioConfigGetCrc(current_idx, &gotCrc);
        if (status == UWBAPI_STATUS_OK) {
            if (gotCrc == expectedCrc) {
                /* Same radio configs, so skip */
                goto exit;
            }
        }
    }
restart:
    status =
        UwbApi_SendRawCommand((uint8_t *)&UCI_RadioCfg_Init_Seq[0], sizeof(UCI_RadioCfg_Init_Seq), respBuf, &respLen);
    if (status == UWBAPI_STATUS_HPD_WAKEUP) {
        goto restart;
    }
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_00[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_00), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_01[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_01), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_02[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_02), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_03[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_03), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status =
        UwbApi_SendRawCommand((uint8_t *)&UCI_RadioCfg_Flash_Seq[0], sizeof(UCI_RadioCfg_Flash_Seq), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }

exit:
    // Exit code comes here
    return status;
}

// Rx_Empty_512_0x0C :  #End

// Rx_SP0_BPRF_Prmbl64_Sfd0_Sts0_Data6M8 :  #Start

static tUWBAPI_STATUS RadioConfig_Rx_SP0_BPRF_Prmbl64_Sfd0_Sts0_Data6M8_0x0D(bool force_update)
{
    tUWBAPI_STATUS status;
    uint16_t respLen = 0x05;
    uint8_t respBuf[5];
    const uint8_t current_idx  = SR040_RADIO_CFG_IDX_0x0D_IDX;
    const uint16_t expectedCrc = SR040_RADIO_CFG_IDX_0x0D_CRC;
    /* clang-format off */
    const uint8_t UCI_RadioCfg_Init_Seq[] =
    {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00,0x02,
        kSR040_RadioCrc_InitDownload,
        SR040_RADIO_CFG_IDX_0x0D_IDX /* index */
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_00[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x00, 0x00,
        0x80,
        0x01, 0x00, 0x00, 0x00, 0x88, 0x13, 0x00, 0x05, 0x10, 0x14, 0x74, 0x00, 0x01, 0x00, 0x00, 0x00, 0xFF, 0x7F, 0x00, 0x80, 0x00, 0x00, 0x56, 0x45, 0x04, 0x7C, 0x1C, 0x40, 0x02, 0x05, 0x35, 0x04, 0x7E, 0x00, 0x00, 0x00, 0x8F, 0x98, 0x19, 0x00, 0x04, 0x70, 0x00, 0x00, 0x10, 0x10, 0x14, 0x0C, 0xC4, 0x00, 0x06, 0x00, 0x08, 0x26, 0x54, 0x00, 0x04, 0x0C, 0x04, 0x04, 0x1C, 0x07, 0x04, 0x1C, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x03, 0x02, 0x00, 0x19, 0x02, 0x19, 0x02, 0x00, 0x03, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0x00, 0x0F, 0x00, 0xFF, 0x03, 0xFF, 0x03, 0x00, 0x2E, 0x03, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x50, 0x03, 0x60, 0x08, 0x01, 0x02, 0x00, 0x03, 0x04, 0x06, 0x06, 0x06, 0x38, 0x04, 0x0A, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00,
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_01[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x80, 0x00,
        0x80,
        0x09, 0x00, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x0F, 0x07, 0x01, 0x02, 0x00, 0x00, 0x08, 0x08, 0x0F, 0x0F, 0x05, 0x07, 0x00, 0x09, 0x00, 0x11, 0x00, 0x31, 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x01, 0x01, 0x02, 0x03, 0x08, 0x08, 0x08, 0x08, 0x04, 0x05, 0x07, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9A, 0x10, 0x02, 0x04, 0x07, 0x10, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x33, 0x0A, 0x00, 0x00, 0x06, 0x03, 0x00, 0x00, 0x01, 0x00, 0x6F, 0x00, 0x00, 0x00, 0x29, 0x00, 0x01, 0x01, 0x04, 0x00, 0xFE, 0x21, 0x00, 0x00, 0x00, 0x24, 0x04, 0x00, 0x26, 0x0C, 0x01, 0x0C, 0x05, 0x01,
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_02[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x00, 0x01,
        0x80,
        0xFF, 0xFF, 0x59, 0x00, 0x00, 0x20, 0x11, 0x00, 0x07, 0x02, 0x01, 0x00, 0x4A, 0x01, 0x30, 0x00, 0x01, 0x2F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xCD, 0x80, 0x02, 0x10, 0xC8, 0xC2, 0x02, 0x10, 0x22, 0x10, 0x10, 0x0D, 0x00, 0x82, 0x62, 0x12, 0xCD, 0x95, 0x2F, 0x1C, 0xC9, 0xD6, 0xDE, 0x58, 0xBA, 0x33, 0xD5, 0x1F, 0x08, 0x86, 0xE2, 0x06, 0x00, 0xEB, 0x60, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x7F, 0x7F, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00,
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_03[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x80, 0x01,
        0x80,
        0x5E, 0x4F, 0x08, 0x00, 0x00, 0x00, 0x00, 0x12, 0xC2, 0xD3, 0xA4, 0x06, 0xDA, 0xF1, 0xA2, 0x65, 0x79, 0x61, 0x41, 0x00, 0x8A, 0x98, 0x36, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x79, 0x1F, 0x0F, 0x72, 0xFF, 0x2C, 0xF5, 0x32, 0x8A, 0x98, 0x36, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x1C, 0xFE, 0xF8, 0x07, 0x00, 0x70, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x04, 0x00,
    };
    const uint8_t UCI_RadioCfg_Flash_Seq[] =
    {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00,0x03,
        kSR040_RadioCrc_Finish,
        0xF1, 0xB1
    };
    /* clang-format on */
    if (!force_update) {
        uint16_t gotCrc = 0;
        status          = UwbApi_RadioConfigGetCrc(current_idx, &gotCrc);
        if (status == UWBAPI_STATUS_OK) {
            if (gotCrc == expectedCrc) {
                /* Same radio configs, so skip */
                goto exit;
            }
        }
    }
restart:
    status =
        UwbApi_SendRawCommand((uint8_t *)&UCI_RadioCfg_Init_Seq[0], sizeof(UCI_RadioCfg_Init_Seq), respBuf, &respLen);
    if (status == UWBAPI_STATUS_HPD_WAKEUP) {
        goto restart;
    }
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_00[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_00), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_01[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_01), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_02[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_02), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_03[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_03), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status =
        UwbApi_SendRawCommand((uint8_t *)&UCI_RadioCfg_Flash_Seq[0], sizeof(UCI_RadioCfg_Flash_Seq), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }

exit:
    // Exit code comes here
    return status;
}

// Rx_SP0_BPRF_Prmbl64_Sfd0_Sts0_Data6M8 :  #End

// Rx_SP1_BPRF_Prmbl64_Sfd0_Sts64_1_Data6M8 :  #Start

static tUWBAPI_STATUS RadioConfig_Rx_SP1_BPRF_Prmbl64_Sfd0_Sts64_1_Data6M8_0x0E(bool force_update)
{
    tUWBAPI_STATUS status;
    uint16_t respLen = 0x05;
    uint8_t respBuf[5];
    const uint8_t current_idx  = SR040_RADIO_CFG_IDX_0x0E_IDX;
    const uint16_t expectedCrc = SR040_RADIO_CFG_IDX_0x0E_CRC;
    /* clang-format off */
    const uint8_t UCI_RadioCfg_Init_Seq[] =
    {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00,0x02,
        kSR040_RadioCrc_InitDownload,
        SR040_RADIO_CFG_IDX_0x0E_IDX /* index */
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_00[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x00, 0x00,
        0x80,
        0x01, 0x00, 0x00, 0x00, 0x88, 0x13, 0x00, 0x05, 0x10, 0x14, 0x74, 0x00, 0x01, 0x00, 0x00, 0x00, 0xFF, 0x7F, 0x00, 0x80, 0x00, 0x00, 0x56, 0x45, 0x04, 0x7C, 0x1C, 0x40, 0x02, 0x05, 0x35, 0x04, 0x7E, 0x00, 0x00, 0x00, 0x8F, 0x98, 0x19, 0x00, 0x04, 0x70, 0x00, 0x00, 0x10, 0x10, 0x14, 0x0C, 0xC4, 0x00, 0x06, 0x00, 0x08, 0x26, 0x54, 0x00, 0x04, 0x0C, 0x04, 0x04, 0x1C, 0x07, 0x04, 0x1C, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x03, 0x02, 0x00, 0x19, 0x02, 0x19, 0x02, 0x00, 0x03, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0x00, 0x0F, 0x00, 0x3F, 0x00, 0xFF, 0x03, 0x00, 0x2E, 0x03, 0x00, 0x10, 0x00, 0x08, 0x00, 0x10, 0x00, 0x50, 0x03, 0x60, 0x08, 0x01, 0x02, 0x00, 0x03, 0x04, 0x06, 0x06, 0x06, 0x38, 0x04, 0x0A, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00,
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_01[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x80, 0x00,
        0x80,
        0x09, 0x00, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x0F, 0x07, 0x01, 0x02, 0x00, 0x00, 0x08, 0x08, 0x0F, 0x0F, 0x05, 0x07, 0x00, 0x09, 0x00, 0x11, 0x00, 0x31, 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x01, 0x01, 0x02, 0x03, 0x08, 0x08, 0x08, 0x08, 0x04, 0x05, 0x07, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9A, 0x10, 0x02, 0x04, 0x07, 0x10, 0x2E, 0x3F, 0x00, 0x00, 0x00, 0x37, 0x0A, 0x06, 0x00, 0x06, 0x03, 0x00, 0x00, 0x01, 0x00, 0x6F, 0x00, 0x00, 0x00, 0x29, 0x00, 0x01, 0x01, 0x04, 0x00, 0xFE, 0x21, 0x00, 0x00, 0x00, 0x24, 0x04, 0x00, 0x26, 0x0C, 0x01, 0x0C, 0x05, 0x01,
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_02[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x00, 0x01,
        0x80,
        0xFF, 0xFF, 0x59, 0x00, 0x00, 0x20, 0x11, 0x00, 0x07, 0x02, 0x01, 0x00, 0x4A, 0x01, 0x30, 0x00, 0x01, 0x2F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xCD, 0x80, 0x02, 0x10, 0xC8, 0xC2, 0x02, 0x10, 0x22, 0x10, 0x10, 0x0D, 0x00, 0x82, 0x62, 0x12, 0xCD, 0x95, 0x2F, 0x1C, 0xC9, 0xD6, 0xDE, 0x58, 0xBA, 0x33, 0xD5, 0x1F, 0x08, 0x86, 0xE2, 0x06, 0x00, 0xEB, 0x60, 0x04, 0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x6A, 0x7F, 0x00, 0x6A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00,
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_03[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x80, 0x01,
        0x80,
        0x5E, 0x4F, 0x04, 0x00, 0x00, 0x00, 0x00, 0x24, 0xC2, 0xD3, 0xA4, 0x06, 0xDA, 0xF1, 0xA2, 0x65, 0x79, 0x61, 0x41, 0x00, 0x8A, 0x98, 0x36, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x79, 0x1F, 0x0F, 0x72, 0xFF, 0x2C, 0xF5, 0x32, 0x8A, 0x98, 0x36, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x1C, 0xFE, 0xF8, 0x07, 0x00, 0x70, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x04, 0x00,
    };
    const uint8_t UCI_RadioCfg_Flash_Seq[] =
    {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00,0x03,
        kSR040_RadioCrc_Finish,
        0xE1, 0x36
    };
    /* clang-format on */
    if (!force_update) {
        uint16_t gotCrc = 0;
        status          = UwbApi_RadioConfigGetCrc(current_idx, &gotCrc);
        if (status == UWBAPI_STATUS_OK) {
            if (gotCrc == expectedCrc) {
                /* Same radio configs, so skip */
                goto exit;
            }
        }
    }
restart:
    status =
        UwbApi_SendRawCommand((uint8_t *)&UCI_RadioCfg_Init_Seq[0], sizeof(UCI_RadioCfg_Init_Seq), respBuf, &respLen);
    if (status == UWBAPI_STATUS_HPD_WAKEUP) {
        goto restart;
    }
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_00[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_00), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_01[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_01), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_02[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_02), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_03[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_03), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status =
        UwbApi_SendRawCommand((uint8_t *)&UCI_RadioCfg_Flash_Seq[0], sizeof(UCI_RadioCfg_Flash_Seq), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }

exit:
    // Exit code comes here
    return status;
}

// Rx_SP1_BPRF_Prmbl64_Sfd0_Sts64_1_Data6M8 :  #End

// Rx_Empty_512_0x0F :  #Start

static tUWBAPI_STATUS RadioConfig_Rx_Empty_512_0x0F_0x0F(bool force_update)
{
    tUWBAPI_STATUS status;
    uint16_t respLen = 0x05;
    uint8_t respBuf[5];
    const uint8_t current_idx  = SR040_RADIO_CFG_IDX_0x0F_IDX;
    const uint16_t expectedCrc = SR040_RADIO_CFG_IDX_0x0F_CRC;
    /* clang-format off */
    const uint8_t UCI_RadioCfg_Init_Seq[] =
    {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00,0x02,
        kSR040_RadioCrc_InitDownload,
        SR040_RADIO_CFG_IDX_0x0F_IDX /* index */
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_00[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x00, 0x00,
        0x80,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_01[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x80, 0x00,
        0x80,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_02[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x00, 0x01,
        0x80,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_03[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x80, 0x01,
        0x80,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    };
    const uint8_t UCI_RadioCfg_Flash_Seq[] =
    {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00,0x03,
        kSR040_RadioCrc_Finish,
        0x00, 0x00
    };
    /* clang-format on */
    if (!force_update) {
        uint16_t gotCrc = 0;
        status          = UwbApi_RadioConfigGetCrc(current_idx, &gotCrc);
        if (status == UWBAPI_STATUS_OK) {
            if (gotCrc == expectedCrc) {
                /* Same radio configs, so skip */
                goto exit;
            }
        }
    }
restart:
    status =
        UwbApi_SendRawCommand((uint8_t *)&UCI_RadioCfg_Init_Seq[0], sizeof(UCI_RadioCfg_Init_Seq), respBuf, &respLen);
    if (status == UWBAPI_STATUS_HPD_WAKEUP) {
        goto restart;
    }
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_00[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_00), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_01[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_01), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_02[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_02), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_03[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_03), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status =
        UwbApi_SendRawCommand((uint8_t *)&UCI_RadioCfg_Flash_Seq[0], sizeof(UCI_RadioCfg_Flash_Seq), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }

exit:
    // Exit code comes here
    return status;
}

// Rx_Empty_512_0x0F :  #End

// Tx_SP0_BPRF_Prmbl64_Sfd0_Sts0_Data6M8 :  #Start

static tUWBAPI_STATUS RadioConfig_Tx_SP0_BPRF_Prmbl64_Sfd0_Sts0_Data6M8_0x10(bool force_update)
{
    tUWBAPI_STATUS status;
    uint16_t respLen = 0x05;
    uint8_t respBuf[5];
    const uint8_t current_idx  = SR040_RADIO_CFG_IDX_0x10_IDX;
    const uint16_t expectedCrc = SR040_RADIO_CFG_IDX_0x10_CRC;
    /* clang-format off */
    const uint8_t UCI_RadioCfg_Init_Seq[] =
    {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00,0x02,
        kSR040_RadioCrc_InitDownload,
        SR040_RADIO_CFG_IDX_0x10_IDX /* index */
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_00[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x00, 0x00,
        0x80,
        0x0B, 0x1F, 0x3A, 0x4E, 0x4D, 0x36, 0x12, 0xF3, 0xE6, 0xED, 0xFC, 0x07, 0x07, 0x02, 0xFB, 0xFA, 0xFC, 0x00, 0x01, 0x01, 0x00, 0xFE, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x1F, 0x3A, 0x4E, 0x4D, 0x36, 0x12, 0xF3, 0xE6, 0xED, 0xFC, 0x07, 0x07, 0x02, 0xFB, 0xFA, 0xFC, 0x00, 0x01, 0x01, 0x00, 0xFE, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x1F, 0x3A, 0x4E, 0x4D, 0x36, 0x12, 0xF3, 0xE6, 0xED, 0xFC, 0x07, 0x07, 0x02, 0xFB, 0xFA, 0xFC, 0x00, 0x01, 0x01, 0x00, 0xFE, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0x08, 0x01, 0x33, 0x00, 0x95, 0x0D, 0x00, 0x00, 0x83, 0xEB, 0x3F, 0x00, 0x41, 0xC0, 0x3C, 0x7C, 0x44, 0x70, 0x17, 0x01, 0xD4, 0x40, 0x30, 0x3C, 0x47, 0x3C, 0x57, 0x14,
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_01[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x80, 0x00,
        0x80,
        0xD0, 0x04, 0x53, 0x53, 0xC1, 0x41, 0xC4, 0xD4, 0x7D, 0x00, 0x10, 0x00, 0x07, 0x30, 0x03, 0x1F, 0x00, 0x00, 0x00, 0x00, 0xC4, 0xC1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2E, 0x40, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x80, 0x01, 0x14, 0x00, 0x80, 0x3F, 0x12, 0x00, 0xF8, 0x02, 0xE8, 0x73, 0x00, 0x00, 0x24, 0x08, 0x00, 0x00, 0xCD, 0x0C, 0x00, 0x00, 0x1D, 0x01, 0x13, 0x00, 0x1B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x04, 0x00,
    };
    const uint8_t UCI_RadioCfg_Flash_Seq[] =
    {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00,0x03,
        kSR040_RadioCrc_Finish,
        0xF7, 0x0E
    };
    /* clang-format on */
    if (!force_update) {
        uint16_t gotCrc = 0;
        status          = UwbApi_RadioConfigGetCrc(current_idx, &gotCrc);
        if (status == UWBAPI_STATUS_OK) {
            if (gotCrc == expectedCrc) {
                /* Same radio configs, so skip */
                goto exit;
            }
        }
    }
restart:
    status =
        UwbApi_SendRawCommand((uint8_t *)&UCI_RadioCfg_Init_Seq[0], sizeof(UCI_RadioCfg_Init_Seq), respBuf, &respLen);
    if (status == UWBAPI_STATUS_HPD_WAKEUP) {
        goto restart;
    }
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_00[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_00), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_01[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_01), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status =
        UwbApi_SendRawCommand((uint8_t *)&UCI_RadioCfg_Flash_Seq[0], sizeof(UCI_RadioCfg_Flash_Seq), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }

exit:
    // Exit code comes here
    return status;
}

// Tx_SP0_BPRF_Prmbl64_Sfd0_Sts0_Data6M8 :  #End

// Tx_SP1_BPRF_Prmbl64_Sfd0_Sts64_1_Data6M8 :  #Start

static tUWBAPI_STATUS RadioConfig_Tx_SP1_BPRF_Prmbl64_Sfd0_Sts64_1_Data6M8_0x11(bool force_update)
{
    tUWBAPI_STATUS status;
    uint16_t respLen = 0x05;
    uint8_t respBuf[5];
    const uint8_t current_idx  = SR040_RADIO_CFG_IDX_0x11_IDX;
    const uint16_t expectedCrc = SR040_RADIO_CFG_IDX_0x11_CRC;
    /* clang-format off */
    const uint8_t UCI_RadioCfg_Init_Seq[] =
    {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00,0x02,
        kSR040_RadioCrc_InitDownload,
        SR040_RADIO_CFG_IDX_0x11_IDX /* index */
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_00[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x00, 0x00,
        0x80,
        0x0B, 0x1F, 0x3A, 0x4E, 0x4D, 0x36, 0x12, 0xF3, 0xE6, 0xED, 0xFC, 0x07, 0x07, 0x02, 0xFB, 0xFA, 0xFC, 0x00, 0x01, 0x01, 0x00, 0xFE, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x1F, 0x3A, 0x4E, 0x4D, 0x36, 0x12, 0xF3, 0xE6, 0xED, 0xFC, 0x07, 0x07, 0x02, 0xFB, 0xFA, 0xFC, 0x00, 0x01, 0x01, 0x00, 0xFE, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x1F, 0x3A, 0x4E, 0x4D, 0x36, 0x12, 0xF3, 0xE6, 0xED, 0xFC, 0x07, 0x07, 0x02, 0xFB, 0xFA, 0xFC, 0x00, 0x01, 0x01, 0x00, 0xFE, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0x08, 0x01, 0x33, 0x00, 0x95, 0x0D, 0x00, 0x00, 0x83, 0xEB, 0x3F, 0x00, 0x41, 0xC0, 0x3C, 0x7C, 0x44, 0x70, 0x17, 0x01, 0xD4, 0x40, 0x30, 0x3C, 0x47, 0x3C, 0x57, 0x14,
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_01[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x80, 0x00,
        0x80,
        0xD0, 0x04, 0x53, 0x53, 0xC1, 0x41, 0xC4, 0xD4, 0x7D, 0x00, 0x10, 0x00, 0x07, 0x30, 0x03, 0x1F, 0x00, 0x00, 0x00, 0x00, 0xC4, 0xC1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x20, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x0A, 0x00, 0x80, 0x01, 0x14, 0x00, 0x80, 0x3F, 0x12, 0x00, 0xF8, 0x02, 0xE8, 0x73, 0x00, 0x00, 0x24, 0x08, 0x00, 0x00, 0xCD, 0x0C, 0x00, 0x00, 0x1D, 0x01, 0x13, 0x00, 0x1B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x04, 0x00,
    };
    const uint8_t UCI_RadioCfg_Flash_Seq[] =
    {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00,0x03,
        kSR040_RadioCrc_Finish,
        0x2D, 0xE7
    };
    /* clang-format on */
    if (!force_update) {
        uint16_t gotCrc = 0;
        status          = UwbApi_RadioConfigGetCrc(current_idx, &gotCrc);
        if (status == UWBAPI_STATUS_OK) {
            if (gotCrc == expectedCrc) {
                /* Same radio configs, so skip */
                goto exit;
            }
        }
    }
restart:
    status =
        UwbApi_SendRawCommand((uint8_t *)&UCI_RadioCfg_Init_Seq[0], sizeof(UCI_RadioCfg_Init_Seq), respBuf, &respLen);
    if (status == UWBAPI_STATUS_HPD_WAKEUP) {
        goto restart;
    }
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_00[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_00), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_01[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_01), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status =
        UwbApi_SendRawCommand((uint8_t *)&UCI_RadioCfg_Flash_Seq[0], sizeof(UCI_RadioCfg_Flash_Seq), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }

exit:
    // Exit code comes here
    return status;
}

// Tx_SP1_BPRF_Prmbl64_Sfd0_Sts64_1_Data6M8 :  #End

// Tx_SP0_BPRF_Prmbl64_Sfd2_Sts0_Data6M8 :  #Start

static tUWBAPI_STATUS RadioConfig_Tx_SP0_BPRF_Prmbl64_Sfd2_Sts0_Data6M8_0x12(bool force_update)
{
    tUWBAPI_STATUS status;
    uint16_t respLen = 0x05;
    uint8_t respBuf[5];
    const uint8_t current_idx  = SR040_RADIO_CFG_IDX_0x12_IDX;
    const uint16_t expectedCrc = SR040_RADIO_CFG_IDX_0x12_CRC;
    /* clang-format off */
    const uint8_t UCI_RadioCfg_Init_Seq[] =
    {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00,0x02,
        kSR040_RadioCrc_InitDownload,
        SR040_RADIO_CFG_IDX_0x12_IDX /* index */
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_00[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x00, 0x00,
        0x80,
        0x0B, 0x1F, 0x3A, 0x4E, 0x4D, 0x36, 0x12, 0xF3, 0xE6, 0xED, 0xFC, 0x07, 0x07, 0x02, 0xFB, 0xFA, 0xFC, 0x00, 0x01, 0x01, 0x00, 0xFE, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x1F, 0x3A, 0x4E, 0x4D, 0x36, 0x12, 0xF3, 0xE6, 0xED, 0xFC, 0x07, 0x07, 0x02, 0xFB, 0xFA, 0xFC, 0x00, 0x01, 0x01, 0x00, 0xFE, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x1F, 0x3A, 0x4E, 0x4D, 0x36, 0x12, 0xF3, 0xE6, 0xED, 0xFC, 0x07, 0x07, 0x02, 0xFB, 0xFA, 0xFC, 0x00, 0x01, 0x01, 0x00, 0xFE, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0x08, 0x01, 0x33, 0x00, 0x95, 0x0D, 0x00, 0x00, 0x83, 0xEB, 0x3F, 0x00, 0x41, 0xC0, 0x3C, 0x7C, 0x44, 0x70, 0x17, 0x01, 0xD4, 0x40, 0x30, 0x3C, 0x47, 0x3C, 0x57, 0x14,
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_01[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x80, 0x00,
        0x80,
        0xD0, 0x04, 0x53, 0x53, 0xC1, 0x41, 0xC4, 0xD4, 0x7D, 0x00, 0x10, 0x00, 0x07, 0x30, 0x03, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xDF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2E, 0x40, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x80, 0x01, 0x14, 0x00, 0x80, 0x3F, 0x12, 0x00, 0xF8, 0x02, 0xE8, 0x73, 0x00, 0x00, 0x24, 0x08, 0x00, 0x00, 0xCD, 0x0C, 0x00, 0x00, 0x1D, 0x01, 0x13, 0x00, 0x1B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x04, 0x00,
    };
    const uint8_t UCI_RadioCfg_Flash_Seq[] =
    {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00,0x03,
        kSR040_RadioCrc_Finish,
        0xE5, 0x6E
    };
    /* clang-format on */
    if (!force_update) {
        uint16_t gotCrc = 0;
        status          = UwbApi_RadioConfigGetCrc(current_idx, &gotCrc);
        if (status == UWBAPI_STATUS_OK) {
            if (gotCrc == expectedCrc) {
                /* Same radio configs, so skip */
                goto exit;
            }
        }
    }
restart:
    status =
        UwbApi_SendRawCommand((uint8_t *)&UCI_RadioCfg_Init_Seq[0], sizeof(UCI_RadioCfg_Init_Seq), respBuf, &respLen);
    if (status == UWBAPI_STATUS_HPD_WAKEUP) {
        goto restart;
    }
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_00[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_00), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_01[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_01), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status =
        UwbApi_SendRawCommand((uint8_t *)&UCI_RadioCfg_Flash_Seq[0], sizeof(UCI_RadioCfg_Flash_Seq), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }

exit:
    // Exit code comes here
    return status;
}

// Tx_SP0_BPRF_Prmbl64_Sfd2_Sts0_Data6M8 :  #End

// Tx_SP1_BPRF_Prmbl64_Sfd2_Sts64_1_Data6M8 :  #Start

static tUWBAPI_STATUS RadioConfig_Tx_SP1_BPRF_Prmbl64_Sfd2_Sts64_1_Data6M8_0x13(bool force_update)
{
    tUWBAPI_STATUS status;
    uint16_t respLen = 0x05;
    uint8_t respBuf[5];
    const uint8_t current_idx  = SR040_RADIO_CFG_IDX_0x13_IDX;
    const uint16_t expectedCrc = SR040_RADIO_CFG_IDX_0x13_CRC;
    /* clang-format off */
    const uint8_t UCI_RadioCfg_Init_Seq[] =
    {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00,0x02,
        kSR040_RadioCrc_InitDownload,
        SR040_RADIO_CFG_IDX_0x13_IDX /* index */
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_00[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x00, 0x00,
        0x80,
        0x0B, 0x1F, 0x3A, 0x4E, 0x4D, 0x36, 0x12, 0xF3, 0xE6, 0xED, 0xFC, 0x07, 0x07, 0x02, 0xFB, 0xFA, 0xFC, 0x00, 0x01, 0x01, 0x00, 0xFE, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x1F, 0x3A, 0x4E, 0x4D, 0x36, 0x12, 0xF3, 0xE6, 0xED, 0xFC, 0x07, 0x07, 0x02, 0xFB, 0xFA, 0xFC, 0x00, 0x01, 0x01, 0x00, 0xFE, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x1F, 0x3A, 0x4E, 0x4D, 0x36, 0x12, 0xF3, 0xE6, 0xED, 0xFC, 0x07, 0x07, 0x02, 0xFB, 0xFA, 0xFC, 0x00, 0x01, 0x01, 0x00, 0xFE, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0x08, 0x01, 0x33, 0x00, 0x95, 0x0D, 0x00, 0x00, 0x83, 0xEB, 0x3F, 0x00, 0x41, 0xC0, 0x3C, 0x7C, 0x44, 0x70, 0x17, 0x01, 0xD4, 0x40, 0x30, 0x3C, 0x47, 0x3C, 0x57, 0x14,
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_01[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x80, 0x00,
        0x80,
        0xD0, 0x04, 0x53, 0x53, 0xC1, 0x41, 0xC4, 0xD4, 0x7D, 0x00, 0x10, 0x00, 0x07, 0x30, 0x03, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xDF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x20, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x0A, 0x00, 0x80, 0x01, 0x14, 0x00, 0x80, 0x3F, 0x12, 0x00, 0xF8, 0x02, 0xE8, 0x73, 0x00, 0x00, 0x24, 0x08, 0x00, 0x00, 0xCD, 0x0C, 0x00, 0x00, 0x1D, 0x01, 0x13, 0x00, 0x1B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x04, 0x00,
    };
    const uint8_t UCI_RadioCfg_Flash_Seq[] =
    {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00,0x03,
        kSR040_RadioCrc_Finish,
        0x3F, 0x87
    };
    /* clang-format on */
    if (!force_update) {
        uint16_t gotCrc = 0;
        status          = UwbApi_RadioConfigGetCrc(current_idx, &gotCrc);
        if (status == UWBAPI_STATUS_OK) {
            if (gotCrc == expectedCrc) {
                /* Same radio configs, so skip */
                goto exit;
            }
        }
    }
restart:
    status =
        UwbApi_SendRawCommand((uint8_t *)&UCI_RadioCfg_Init_Seq[0], sizeof(UCI_RadioCfg_Init_Seq), respBuf, &respLen);
    if (status == UWBAPI_STATUS_HPD_WAKEUP) {
        goto restart;
    }
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_00[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_00), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_01[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_01), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status =
        UwbApi_SendRawCommand((uint8_t *)&UCI_RadioCfg_Flash_Seq[0], sizeof(UCI_RadioCfg_Flash_Seq), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }

exit:
    // Exit code comes here
    return status;
}

// Tx_SP1_BPRF_Prmbl64_Sfd2_Sts64_1_Data6M8 :  #End

// Tx_SP0_hprf_Prmbl32_Sfd2_Sts0_Data6M8 :  #Start

static tUWBAPI_STATUS RadioConfig_Tx_SP0_hprf_Prmbl32_Sfd2_Sts0_Data6M8_0x14(bool force_update)
{
    tUWBAPI_STATUS status;
    uint16_t respLen = 0x05;
    uint8_t respBuf[5];
    const uint8_t current_idx  = SR040_RADIO_CFG_IDX_0x14_IDX;
    const uint16_t expectedCrc = SR040_RADIO_CFG_IDX_0x14_CRC;
    /* clang-format off */
    const uint8_t UCI_RadioCfg_Init_Seq[] =
    {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00,0x02,
        kSR040_RadioCrc_InitDownload,
        SR040_RADIO_CFG_IDX_0x14_IDX /* index */
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_00[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x00, 0x00,
        0x80,
        0x0B, 0x1F, 0x3A, 0x4E, 0x4D, 0x36, 0x12, 0xF3, 0xE6, 0xED, 0xFC, 0x07, 0x07, 0x02, 0xFB, 0xFA, 0xFC, 0x00, 0x01, 0x01, 0x00, 0xFE, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x1F, 0x3A, 0x4E, 0x4D, 0x36, 0x12, 0xF3, 0xE6, 0xED, 0xFC, 0x07, 0x07, 0x02, 0xFB, 0xFA, 0xFC, 0x00, 0x01, 0x01, 0x00, 0xFE, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x1F, 0x3A, 0x4E, 0x4D, 0x36, 0x12, 0xF3, 0xE6, 0xED, 0xFC, 0x07, 0x07, 0x02, 0xFB, 0xFA, 0xFC, 0x00, 0x01, 0x01, 0x00, 0xFE, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x08, 0x00, 0x00, 0xD0, 0x00, 0x23, 0x00, 0xEA, 0x08, 0x00, 0x00, 0x9E, 0xF4, 0x2D, 0x00, 0x53, 0xF5, 0x7D, 0x57, 0xDD, 0x5F, 0x5F, 0x55, 0xD7, 0x41, 0x1F, 0x1F, 0x55, 0x7D, 0xF5, 0x3C,
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_01[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x80, 0x00,
        0x80,
        0xDD, 0x3F, 0x77, 0x47, 0x5F, 0x77, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xDF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2E, 0x40, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x80, 0x01, 0x14, 0x00, 0x80, 0x3F, 0x12, 0x00, 0xF8, 0x03, 0xE8, 0x73, 0x00, 0x00, 0x24, 0x08, 0x00, 0x00, 0xCD, 0x0C, 0x00, 0x00, 0xE5, 0x00, 0x13, 0x00, 0x14, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x70, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x04, 0x00,
    };
    const uint8_t UCI_RadioCfg_Flash_Seq[] =
    {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00,0x03,
        kSR040_RadioCrc_Finish,
        0x38, 0x0C
    };
    /* clang-format on */
    if (!force_update) {
        uint16_t gotCrc = 0;
        status          = UwbApi_RadioConfigGetCrc(current_idx, &gotCrc);
        if (status == UWBAPI_STATUS_OK) {
            if (gotCrc == expectedCrc) {
                /* Same radio configs, so skip */
                goto exit;
            }
        }
    }
restart:
    status =
        UwbApi_SendRawCommand((uint8_t *)&UCI_RadioCfg_Init_Seq[0], sizeof(UCI_RadioCfg_Init_Seq), respBuf, &respLen);
    if (status == UWBAPI_STATUS_HPD_WAKEUP) {
        goto restart;
    }
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_00[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_00), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_01[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_01), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status =
        UwbApi_SendRawCommand((uint8_t *)&UCI_RadioCfg_Flash_Seq[0], sizeof(UCI_RadioCfg_Flash_Seq), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }

exit:
    // Exit code comes here
    return status;
}

// Tx_SP0_hprf_Prmbl32_Sfd2_Sts0_Data6M8 :  #End

// Tx_SP0_hprf_Prmbl32_Sfd2_Sts0_Data7M8 :  #Start

static tUWBAPI_STATUS RadioConfig_Tx_SP0_hprf_Prmbl32_Sfd2_Sts0_Data7M8_0x15(bool force_update)
{
    tUWBAPI_STATUS status;
    uint16_t respLen = 0x05;
    uint8_t respBuf[5];
    const uint8_t current_idx  = SR040_RADIO_CFG_IDX_0x15_IDX;
    const uint16_t expectedCrc = SR040_RADIO_CFG_IDX_0x15_CRC;
    /* clang-format off */
    const uint8_t UCI_RadioCfg_Init_Seq[] =
    {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00,0x02,
        kSR040_RadioCrc_InitDownload,
        SR040_RADIO_CFG_IDX_0x15_IDX /* index */
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_00[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x00, 0x00,
        0x80,
        0x0B, 0x1F, 0x3A, 0x4E, 0x4D, 0x36, 0x12, 0xF3, 0xE6, 0xED, 0xFC, 0x07, 0x07, 0x02, 0xFB, 0xFA, 0xFC, 0x00, 0x01, 0x01, 0x00, 0xFE, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x1F, 0x3A, 0x4E, 0x4D, 0x36, 0x12, 0xF3, 0xE6, 0xED, 0xFC, 0x07, 0x07, 0x02, 0xFB, 0xFA, 0xFC, 0x00, 0x01, 0x01, 0x00, 0xFE, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x1F, 0x3A, 0x4E, 0x4D, 0x36, 0x12, 0xF3, 0xE6, 0xED, 0xFC, 0x07, 0x07, 0x02, 0xFB, 0xFA, 0xFC, 0x00, 0x01, 0x01, 0x00, 0xFE, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x08, 0x00, 0x00, 0xA6, 0x00, 0x23, 0x00, 0xD9, 0x08, 0x00, 0x00, 0x9E, 0xF4, 0x2D, 0x00, 0x53, 0xF5, 0x7D, 0x57, 0xDD, 0x5F, 0x5F, 0x55, 0xD7, 0x41, 0x1F, 0x1F, 0x55, 0x7D, 0xF5, 0x3C,
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_01[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x80, 0x00,
        0x80,
        0xDD, 0x3F, 0x77, 0x47, 0x5F, 0x77, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xDF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2E, 0x40, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x80, 0x01, 0x14, 0x00, 0x80, 0x3F, 0x12, 0x00, 0xF8, 0x03, 0xE8, 0x73, 0x00, 0x00, 0x24, 0x08, 0x00, 0x00, 0xCD, 0x0C, 0x00, 0x00, 0xBF, 0x00, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x70, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x04, 0x00,
    };
    const uint8_t UCI_RadioCfg_Flash_Seq[] =
    {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00,0x03,
        kSR040_RadioCrc_Finish,
        0x84, 0x2C
    };
    /* clang-format on */
    if (!force_update) {
        uint16_t gotCrc = 0;
        status          = UwbApi_RadioConfigGetCrc(current_idx, &gotCrc);
        if (status == UWBAPI_STATUS_OK) {
            if (gotCrc == expectedCrc) {
                /* Same radio configs, so skip */
                goto exit;
            }
        }
    }
restart:
    status =
        UwbApi_SendRawCommand((uint8_t *)&UCI_RadioCfg_Init_Seq[0], sizeof(UCI_RadioCfg_Init_Seq), respBuf, &respLen);
    if (status == UWBAPI_STATUS_HPD_WAKEUP) {
        goto restart;
    }
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_00[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_00), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_01[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_01), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status =
        UwbApi_SendRawCommand((uint8_t *)&UCI_RadioCfg_Flash_Seq[0], sizeof(UCI_RadioCfg_Flash_Seq), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }

exit:
    // Exit code comes here
    return status;
}

// Tx_SP0_hprf_Prmbl32_Sfd2_Sts0_Data7M8 :  #End

// Tx_SP0_hprf_Prmbl64_Sfd2_Sts0_Data6M8 :  #Start

static tUWBAPI_STATUS RadioConfig_Tx_SP0_hprf_Prmbl64_Sfd2_Sts0_Data6M8_0x16(bool force_update)
{
    tUWBAPI_STATUS status;
    uint16_t respLen = 0x05;
    uint8_t respBuf[5];
    const uint8_t current_idx  = SR040_RADIO_CFG_IDX_0x16_IDX;
    const uint16_t expectedCrc = SR040_RADIO_CFG_IDX_0x16_CRC;
    /* clang-format off */
    const uint8_t UCI_RadioCfg_Init_Seq[] =
    {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00,0x02,
        kSR040_RadioCrc_InitDownload,
        SR040_RADIO_CFG_IDX_0x16_IDX /* index */
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_00[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x00, 0x00,
        0x80,
        0x0B, 0x1F, 0x3A, 0x4E, 0x4D, 0x36, 0x12, 0xF3, 0xE6, 0xED, 0xFC, 0x07, 0x07, 0x02, 0xFB, 0xFA, 0xFC, 0x00, 0x01, 0x01, 0x00, 0xFE, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x1F, 0x3A, 0x4E, 0x4D, 0x36, 0x12, 0xF3, 0xE6, 0xED, 0xFC, 0x07, 0x07, 0x02, 0xFB, 0xFA, 0xFC, 0x00, 0x01, 0x01, 0x00, 0xFE, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x1F, 0x3A, 0x4E, 0x4D, 0x36, 0x12, 0xF3, 0xE6, 0xED, 0xFC, 0x07, 0x07, 0x02, 0xFB, 0xFA, 0xFC, 0x00, 0x01, 0x01, 0x00, 0xFE, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0xD0, 0x00, 0x23, 0x00, 0xEA, 0x08, 0x00, 0x00, 0x9E, 0xF4, 0x2D, 0x00, 0x53, 0xF5, 0x7D, 0x57, 0xDD, 0x5F, 0x5F, 0x55, 0xD7, 0x41, 0x1F, 0x1F, 0x55, 0x7D, 0xF5, 0x3C,
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_01[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x80, 0x00,
        0x80,
        0xDD, 0x3F, 0x77, 0x47, 0x5F, 0x77, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xDF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2E, 0x40, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x80, 0x01, 0x14, 0x00, 0x80, 0x3F, 0x12, 0x00, 0xF8, 0x03, 0xE8, 0x73, 0x00, 0x00, 0x24, 0x08, 0x00, 0x00, 0xCD, 0x0C, 0x00, 0x00, 0xE5, 0x00, 0x13, 0x00, 0x14, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x30, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x04, 0x00,
    };
    const uint8_t UCI_RadioCfg_Flash_Seq[] =
    {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00,0x03,
        kSR040_RadioCrc_Finish,
        0x28, 0x34
    };
    /* clang-format on */
    if (!force_update) {
        uint16_t gotCrc = 0;
        status          = UwbApi_RadioConfigGetCrc(current_idx, &gotCrc);
        if (status == UWBAPI_STATUS_OK) {
            if (gotCrc == expectedCrc) {
                /* Same radio configs, so skip */
                goto exit;
            }
        }
    }
restart:
    status =
        UwbApi_SendRawCommand((uint8_t *)&UCI_RadioCfg_Init_Seq[0], sizeof(UCI_RadioCfg_Init_Seq), respBuf, &respLen);
    if (status == UWBAPI_STATUS_HPD_WAKEUP) {
        goto restart;
    }
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_00[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_00), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_01[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_01), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status =
        UwbApi_SendRawCommand((uint8_t *)&UCI_RadioCfg_Flash_Seq[0], sizeof(UCI_RadioCfg_Flash_Seq), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }

exit:
    // Exit code comes here
    return status;
}

// Tx_SP0_hprf_Prmbl64_Sfd2_Sts0_Data6M8 :  #End

// Tx_SP0_hprf_Prmbl64_Sfd2_Sts0_Data7M8 :  #Start

static tUWBAPI_STATUS RadioConfig_Tx_SP0_hprf_Prmbl64_Sfd2_Sts0_Data7M8_0x17(bool force_update)
{
    tUWBAPI_STATUS status;
    uint16_t respLen = 0x05;
    uint8_t respBuf[5];
    const uint8_t current_idx  = SR040_RADIO_CFG_IDX_0x17_IDX;
    const uint16_t expectedCrc = SR040_RADIO_CFG_IDX_0x17_CRC;
    /* clang-format off */
    const uint8_t UCI_RadioCfg_Init_Seq[] =
    {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00,0x02,
        kSR040_RadioCrc_InitDownload,
        SR040_RADIO_CFG_IDX_0x17_IDX /* index */
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_00[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x00, 0x00,
        0x80,
        0x0B, 0x1F, 0x3A, 0x4E, 0x4D, 0x36, 0x12, 0xF3, 0xE6, 0xED, 0xFC, 0x07, 0x07, 0x02, 0xFB, 0xFA, 0xFC, 0x00, 0x01, 0x01, 0x00, 0xFE, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x1F, 0x3A, 0x4E, 0x4D, 0x36, 0x12, 0xF3, 0xE6, 0xED, 0xFC, 0x07, 0x07, 0x02, 0xFB, 0xFA, 0xFC, 0x00, 0x01, 0x01, 0x00, 0xFE, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x1F, 0x3A, 0x4E, 0x4D, 0x36, 0x12, 0xF3, 0xE6, 0xED, 0xFC, 0x07, 0x07, 0x02, 0xFB, 0xFA, 0xFC, 0x00, 0x01, 0x01, 0x00, 0xFE, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0xA6, 0x00, 0x23, 0x00, 0xD9, 0x08, 0x00, 0x00, 0x9E, 0xF4, 0x2D, 0x00, 0x53, 0xF5, 0x7D, 0x57, 0xDD, 0x5F, 0x5F, 0x55, 0xD7, 0x41, 0x1F, 0x1F, 0x55, 0x7D, 0xF5, 0x3C,
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_01[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x80, 0x00,
        0x80,
        0xDD, 0x3F, 0x77, 0x47, 0x5F, 0x77, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xDF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2E, 0x40, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x80, 0x01, 0x14, 0x00, 0x80, 0x3F, 0x12, 0x00, 0xF8, 0x03, 0xE8, 0x73, 0x00, 0x00, 0x24, 0x08, 0x00, 0x00, 0xCD, 0x0C, 0x00, 0x00, 0xBF, 0x00, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x30, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x04, 0x00,
    };
    const uint8_t UCI_RadioCfg_Flash_Seq[] =
    {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00,0x03,
        kSR040_RadioCrc_Finish,
        0x94, 0x14
    };
    /* clang-format on */
    if (!force_update) {
        uint16_t gotCrc = 0;
        status          = UwbApi_RadioConfigGetCrc(current_idx, &gotCrc);
        if (status == UWBAPI_STATUS_OK) {
            if (gotCrc == expectedCrc) {
                /* Same radio configs, so skip */
                goto exit;
            }
        }
    }
restart:
    status =
        UwbApi_SendRawCommand((uint8_t *)&UCI_RadioCfg_Init_Seq[0], sizeof(UCI_RadioCfg_Init_Seq), respBuf, &respLen);
    if (status == UWBAPI_STATUS_HPD_WAKEUP) {
        goto restart;
    }
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_00[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_00), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_01[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_01), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status =
        UwbApi_SendRawCommand((uint8_t *)&UCI_RadioCfg_Flash_Seq[0], sizeof(UCI_RadioCfg_Flash_Seq), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }

exit:
    // Exit code comes here
    return status;
}

// Tx_SP0_hprf_Prmbl64_Sfd2_Sts0_Data7M8 :  #End

// Tx_SP1_hprf_Prmbl32_Sfd2_Sts64_1_Data6M8 :  #Start

static tUWBAPI_STATUS RadioConfig_Tx_SP1_hprf_Prmbl32_Sfd2_Sts64_1_Data6M8_0x18(bool force_update)
{
    tUWBAPI_STATUS status;
    uint16_t respLen = 0x05;
    uint8_t respBuf[5];
    const uint8_t current_idx  = SR040_RADIO_CFG_IDX_0x18_IDX;
    const uint16_t expectedCrc = SR040_RADIO_CFG_IDX_0x18_CRC;
    /* clang-format off */
    const uint8_t UCI_RadioCfg_Init_Seq[] =
    {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00,0x02,
        kSR040_RadioCrc_InitDownload,
        SR040_RADIO_CFG_IDX_0x18_IDX /* index */
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_00[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x00, 0x00,
        0x80,
        0x0B, 0x1F, 0x3A, 0x4E, 0x4D, 0x36, 0x12, 0xF3, 0xE6, 0xED, 0xFC, 0x07, 0x07, 0x02, 0xFB, 0xFA, 0xFC, 0x00, 0x01, 0x01, 0x00, 0xFE, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x1F, 0x3A, 0x4E, 0x4D, 0x36, 0x12, 0xF3, 0xE6, 0xED, 0xFC, 0x07, 0x07, 0x02, 0xFB, 0xFA, 0xFC, 0x00, 0x01, 0x01, 0x00, 0xFE, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x1F, 0x3A, 0x4E, 0x4D, 0x36, 0x12, 0xF3, 0xE6, 0xED, 0xFC, 0x07, 0x07, 0x02, 0xFB, 0xFA, 0xFC, 0x00, 0x01, 0x01, 0x00, 0xFE, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x08, 0x00, 0x00, 0xD0, 0x00, 0x23, 0x00, 0xEA, 0x08, 0x00, 0x00, 0x9E, 0xF4, 0x2D, 0x00, 0x53, 0xF5, 0x7D, 0x57, 0xDD, 0x5F, 0x5F, 0x55, 0xD7, 0x41, 0x1F, 0x1F, 0x55, 0x7D, 0xF5, 0x3C,
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_01[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x80, 0x00,
        0x80,
        0xDD, 0x3F, 0x77, 0x47, 0x5F, 0x77, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xDF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x09, 0x40, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x0A, 0x00, 0x80, 0x01, 0x14, 0x00, 0x80, 0x3F, 0x12, 0x00, 0xF8, 0x03, 0xE8, 0x73, 0x00, 0x00, 0x24, 0x08, 0x00, 0x00, 0xCD, 0x0C, 0x00, 0x00, 0xE5, 0x00, 0x13, 0x00, 0x14, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x70, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x04, 0x00,
    };
    const uint8_t UCI_RadioCfg_Flash_Seq[] =
    {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00,0x03,
        kSR040_RadioCrc_Finish,
        0xEA, 0x37
    };
    /* clang-format on */
    if (!force_update) {
        uint16_t gotCrc = 0;
        status          = UwbApi_RadioConfigGetCrc(current_idx, &gotCrc);
        if (status == UWBAPI_STATUS_OK) {
            if (gotCrc == expectedCrc) {
                /* Same radio configs, so skip */
                goto exit;
            }
        }
    }
restart:
    status =
        UwbApi_SendRawCommand((uint8_t *)&UCI_RadioCfg_Init_Seq[0], sizeof(UCI_RadioCfg_Init_Seq), respBuf, &respLen);
    if (status == UWBAPI_STATUS_HPD_WAKEUP) {
        goto restart;
    }
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_00[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_00), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_01[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_01), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status =
        UwbApi_SendRawCommand((uint8_t *)&UCI_RadioCfg_Flash_Seq[0], sizeof(UCI_RadioCfg_Flash_Seq), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }

exit:
    // Exit code comes here
    return status;
}

// Tx_SP1_hprf_Prmbl32_Sfd2_Sts64_1_Data6M8 :  #End

// Tx_SP1_hprf_Prmbl64_Sfd2_Sts64_2_Data6M8 :  #Start

static tUWBAPI_STATUS RadioConfig_Tx_SP1_hprf_Prmbl64_Sfd2_Sts64_2_Data6M8_0x19(bool force_update)
{
    tUWBAPI_STATUS status;
    uint16_t respLen = 0x05;
    uint8_t respBuf[5];
    const uint8_t current_idx  = SR040_RADIO_CFG_IDX_0x19_IDX;
    const uint16_t expectedCrc = SR040_RADIO_CFG_IDX_0x19_CRC;
    /* clang-format off */
    const uint8_t UCI_RadioCfg_Init_Seq[] =
    {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00,0x02,
        kSR040_RadioCrc_InitDownload,
        SR040_RADIO_CFG_IDX_0x19_IDX /* index */
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_00[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x00, 0x00,
        0x80,
        0x0B, 0x1F, 0x3A, 0x4E, 0x4D, 0x36, 0x12, 0xF3, 0xE6, 0xED, 0xFC, 0x07, 0x07, 0x02, 0xFB, 0xFA, 0xFC, 0x00, 0x01, 0x01, 0x00, 0xFE, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x1F, 0x3A, 0x4E, 0x4D, 0x36, 0x12, 0xF3, 0xE6, 0xED, 0xFC, 0x07, 0x07, 0x02, 0xFB, 0xFA, 0xFC, 0x00, 0x01, 0x01, 0x00, 0xFE, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x1F, 0x3A, 0x4E, 0x4D, 0x36, 0x12, 0xF3, 0xE6, 0xED, 0xFC, 0x07, 0x07, 0x02, 0xFB, 0xFA, 0xFC, 0x00, 0x01, 0x01, 0x00, 0xFE, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0xD0, 0x00, 0x23, 0x00, 0xEA, 0x08, 0x00, 0x00, 0x9E, 0xF4, 0x2D, 0x00, 0x53, 0xF5, 0x7D, 0x57, 0xDD, 0x5F, 0x5F, 0x55, 0xD7, 0x41, 0x1F, 0x1F, 0x55, 0x7D, 0xF5, 0x3C,
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_01[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x80, 0x00,
        0x80,
        0xDD, 0x3F, 0x77, 0x47, 0x5F, 0x77, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xDF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x09, 0x40, 0x00, 0x00, 0x08, 0x20, 0x00, 0x00, 0x0A, 0x00, 0x80, 0x01, 0x14, 0x00, 0x80, 0x3F, 0x12, 0x00, 0xF8, 0x03, 0xE8, 0x73, 0x00, 0x00, 0x24, 0x08, 0x00, 0x00, 0xCD, 0x0C, 0x00, 0x00, 0xE5, 0x00, 0x13, 0x00, 0x14, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x30, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2B, 0xF4, 0x00,
    };
    const uint8_t UCI_RadioCfg_Flash_Seq[] =
    {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00,0x03,
        kSR040_RadioCrc_Finish,
        0x41, 0x9A
    };
    /* clang-format on */
    if (!force_update) {
        uint16_t gotCrc = 0;
        status          = UwbApi_RadioConfigGetCrc(current_idx, &gotCrc);
        if (status == UWBAPI_STATUS_OK) {
            if (gotCrc == expectedCrc) {
                /* Same radio configs, so skip */
                goto exit;
            }
        }
    }
restart:
    status =
        UwbApi_SendRawCommand((uint8_t *)&UCI_RadioCfg_Init_Seq[0], sizeof(UCI_RadioCfg_Init_Seq), respBuf, &respLen);
    if (status == UWBAPI_STATUS_HPD_WAKEUP) {
        goto restart;
    }
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_00[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_00), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_01[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_01), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status =
        UwbApi_SendRawCommand((uint8_t *)&UCI_RadioCfg_Flash_Seq[0], sizeof(UCI_RadioCfg_Flash_Seq), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }

exit:
    // Exit code comes here
    return status;
}

// Tx_SP1_hprf_Prmbl64_Sfd2_Sts64_2_Data6M8 :  #End

// Tx_SP1_hprf_Prmbl64_Sfd2_Sts64_1_Data6M8 :  #Start

static tUWBAPI_STATUS RadioConfig_Tx_SP1_hprf_Prmbl64_Sfd2_Sts64_1_Data6M8_0x1A(bool force_update)
{
    tUWBAPI_STATUS status;
    uint16_t respLen = 0x05;
    uint8_t respBuf[5];
    const uint8_t current_idx  = SR040_RADIO_CFG_IDX_0x1A_IDX;
    const uint16_t expectedCrc = SR040_RADIO_CFG_IDX_0x1A_CRC;
    /* clang-format off */
    const uint8_t UCI_RadioCfg_Init_Seq[] =
    {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00,0x02,
        kSR040_RadioCrc_InitDownload,
        SR040_RADIO_CFG_IDX_0x1A_IDX /* index */
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_00[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x00, 0x00,
        0x80,
        0x0B, 0x1F, 0x3A, 0x4E, 0x4D, 0x36, 0x12, 0xF3, 0xE6, 0xED, 0xFC, 0x07, 0x07, 0x02, 0xFB, 0xFA, 0xFC, 0x00, 0x01, 0x01, 0x00, 0xFE, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x1F, 0x3A, 0x4E, 0x4D, 0x36, 0x12, 0xF3, 0xE6, 0xED, 0xFC, 0x07, 0x07, 0x02, 0xFB, 0xFA, 0xFC, 0x00, 0x01, 0x01, 0x00, 0xFE, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x1F, 0x3A, 0x4E, 0x4D, 0x36, 0x12, 0xF3, 0xE6, 0xED, 0xFC, 0x07, 0x07, 0x02, 0xFB, 0xFA, 0xFC, 0x00, 0x01, 0x01, 0x00, 0xFE, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0xD0, 0x00, 0x23, 0x00, 0xEA, 0x08, 0x00, 0x00, 0x9E, 0xF4, 0x2D, 0x00, 0x53, 0xF5, 0x7D, 0x57, 0xDD, 0x5F, 0x5F, 0x55, 0xD7, 0x41, 0x1F, 0x1F, 0x55, 0x7D, 0xF5, 0x3C,
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_01[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x80, 0x00,
        0x80,
        0xDD, 0x3F, 0x77, 0x47, 0x5F, 0x77, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xDF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x09, 0x40, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x0A, 0x00, 0x80, 0x01, 0x14, 0x00, 0x80, 0x3F, 0x12, 0x00, 0xF8, 0x03, 0xE8, 0x73, 0x00, 0x00, 0x24, 0x08, 0x00, 0x00, 0xCD, 0x0C, 0x00, 0x00, 0xE5, 0x00, 0x13, 0x00, 0x14, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x30, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x04, 0x00,
    };
    const uint8_t UCI_RadioCfg_Flash_Seq[] =
    {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00,0x03,
        kSR040_RadioCrc_Finish,
        0xFA, 0x0F
    };
    /* clang-format on */
    if (!force_update) {
        uint16_t gotCrc = 0;
        status          = UwbApi_RadioConfigGetCrc(current_idx, &gotCrc);
        if (status == UWBAPI_STATUS_OK) {
            if (gotCrc == expectedCrc) {
                /* Same radio configs, so skip */
                goto exit;
            }
        }
    }
restart:
    status =
        UwbApi_SendRawCommand((uint8_t *)&UCI_RadioCfg_Init_Seq[0], sizeof(UCI_RadioCfg_Init_Seq), respBuf, &respLen);
    if (status == UWBAPI_STATUS_HPD_WAKEUP) {
        goto restart;
    }
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_00[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_00), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_01[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_01), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status =
        UwbApi_SendRawCommand((uint8_t *)&UCI_RadioCfg_Flash_Seq[0], sizeof(UCI_RadioCfg_Flash_Seq), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }

exit:
    // Exit code comes here
    return status;
}

// Tx_SP1_hprf_Prmbl64_Sfd2_Sts64_1_Data6M8 :  #End

// Tx_Empty_256_0x1B :  #Start

static tUWBAPI_STATUS RadioConfig_Tx_Empty_256_0x1B_0x1B(bool force_update)
{
    tUWBAPI_STATUS status;
    uint16_t respLen = 0x05;
    uint8_t respBuf[5];
    const uint8_t current_idx  = SR040_RADIO_CFG_IDX_0x1B_IDX;
    const uint16_t expectedCrc = SR040_RADIO_CFG_IDX_0x1B_CRC;
    /* clang-format off */
    const uint8_t UCI_RadioCfg_Init_Seq[] =
    {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00,0x02,
        kSR040_RadioCrc_InitDownload,
        SR040_RADIO_CFG_IDX_0x1B_IDX /* index */
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_00[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x00, 0x00,
        0x80,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_01[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x80, 0x00,
        0x80,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    };
    const uint8_t UCI_RadioCfg_Flash_Seq[] =
    {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00,0x03,
        kSR040_RadioCrc_Finish,
        0x00, 0x00
    };
    /* clang-format on */
    if (!force_update) {
        uint16_t gotCrc = 0;
        status          = UwbApi_RadioConfigGetCrc(current_idx, &gotCrc);
        if (status == UWBAPI_STATUS_OK) {
            if (gotCrc == expectedCrc) {
                /* Same radio configs, so skip */
                goto exit;
            }
        }
    }
restart:
    status =
        UwbApi_SendRawCommand((uint8_t *)&UCI_RadioCfg_Init_Seq[0], sizeof(UCI_RadioCfg_Init_Seq), respBuf, &respLen);
    if (status == UWBAPI_STATUS_HPD_WAKEUP) {
        goto restart;
    }
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_00[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_00), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_01[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_01), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status =
        UwbApi_SendRawCommand((uint8_t *)&UCI_RadioCfg_Flash_Seq[0], sizeof(UCI_RadioCfg_Flash_Seq), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }

exit:
    // Exit code comes here
    return status;
}

// Tx_Empty_256_0x1B :  #End

// Tx_Empty_256_0x1C :  #Start

static tUWBAPI_STATUS RadioConfig_Tx_Empty_256_0x1C_0x1C(bool force_update)
{
    tUWBAPI_STATUS status;
    uint16_t respLen = 0x05;
    uint8_t respBuf[5];
    const uint8_t current_idx  = SR040_RADIO_CFG_IDX_0x1C_IDX;
    const uint16_t expectedCrc = SR040_RADIO_CFG_IDX_0x1C_CRC;
    /* clang-format off */
    const uint8_t UCI_RadioCfg_Init_Seq[] =
    {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00,0x02,
        kSR040_RadioCrc_InitDownload,
        SR040_RADIO_CFG_IDX_0x1C_IDX /* index */
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_00[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x00, 0x00,
        0x80,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_01[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x80, 0x00,
        0x80,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    };
    const uint8_t UCI_RadioCfg_Flash_Seq[] =
    {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00,0x03,
        kSR040_RadioCrc_Finish,
        0x00, 0x00
    };
    /* clang-format on */
    if (!force_update) {
        uint16_t gotCrc = 0;
        status          = UwbApi_RadioConfigGetCrc(current_idx, &gotCrc);
        if (status == UWBAPI_STATUS_OK) {
            if (gotCrc == expectedCrc) {
                /* Same radio configs, so skip */
                goto exit;
            }
        }
    }
restart:
    status =
        UwbApi_SendRawCommand((uint8_t *)&UCI_RadioCfg_Init_Seq[0], sizeof(UCI_RadioCfg_Init_Seq), respBuf, &respLen);
    if (status == UWBAPI_STATUS_HPD_WAKEUP) {
        goto restart;
    }
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_00[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_00), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_01[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_01), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status =
        UwbApi_SendRawCommand((uint8_t *)&UCI_RadioCfg_Flash_Seq[0], sizeof(UCI_RadioCfg_Flash_Seq), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }

exit:
    // Exit code comes here
    return status;
}

// Tx_Empty_256_0x1C :  #End

// Tx_SP0_BPRF_Prmbl64_Sfd0_Sts0_Data6M8 :  #Start

static tUWBAPI_STATUS RadioConfig_Tx_SP0_BPRF_Prmbl64_Sfd0_Sts0_Data6M8_0x1D(bool force_update)
{
    tUWBAPI_STATUS status;
    uint16_t respLen = 0x05;
    uint8_t respBuf[5];
    const uint8_t current_idx  = SR040_RADIO_CFG_IDX_0x1D_IDX;
    const uint16_t expectedCrc = SR040_RADIO_CFG_IDX_0x1D_CRC;
    /* clang-format off */
    const uint8_t UCI_RadioCfg_Init_Seq[] =
    {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00,0x02,
        kSR040_RadioCrc_InitDownload,
        SR040_RADIO_CFG_IDX_0x1D_IDX /* index */
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_00[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x00, 0x00,
        0x80,
        0x0B, 0x1F, 0x3A, 0x4E, 0x4D, 0x36, 0x12, 0xF3, 0xE6, 0xED, 0xFC, 0x07, 0x07, 0x02, 0xFB, 0xFA, 0xFC, 0x00, 0x01, 0x01, 0x00, 0xFE, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x1F, 0x3A, 0x4E, 0x4D, 0x36, 0x12, 0xF3, 0xE6, 0xED, 0xFC, 0x07, 0x07, 0x02, 0xFB, 0xFA, 0xFC, 0x00, 0x01, 0x01, 0x00, 0xFE, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x1F, 0x3A, 0x4E, 0x4D, 0x36, 0x12, 0xF3, 0xE6, 0xED, 0xFC, 0x07, 0x07, 0x02, 0xFB, 0xFA, 0xFC, 0x00, 0x01, 0x01, 0x00, 0xFE, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0x08, 0x01, 0x33, 0x00, 0x95, 0x0D, 0x00, 0x00, 0x83, 0xEB, 0x3F, 0x00, 0x41, 0xC0, 0x3C, 0x7C, 0x44, 0x70, 0x17, 0x01, 0xD4, 0x40, 0x30, 0x3C, 0x47, 0x3C, 0x57, 0x14,
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_01[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x80, 0x00,
        0x80,
        0xD0, 0x04, 0x53, 0x53, 0xC1, 0x41, 0xC4, 0xD4, 0x7D, 0x00, 0x10, 0x00, 0x07, 0x30, 0x03, 0x1F, 0x00, 0x00, 0x00, 0x00, 0xC4, 0xC1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2E, 0x40, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x80, 0x01, 0x14, 0x00, 0x80, 0x3F, 0x12, 0x00, 0xF8, 0x02, 0xE8, 0x73, 0x00, 0x00, 0x24, 0x08, 0x00, 0x00, 0xCD, 0x0C, 0x00, 0x00, 0x1D, 0x01, 0x13, 0x00, 0x1B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x04, 0x00,
    };
    const uint8_t UCI_RadioCfg_Flash_Seq[] =
    {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00,0x03,
        kSR040_RadioCrc_Finish,
        0xF7, 0x0E
    };
    /* clang-format on */
    if (!force_update) {
        uint16_t gotCrc = 0;
        status          = UwbApi_RadioConfigGetCrc(current_idx, &gotCrc);
        if (status == UWBAPI_STATUS_OK) {
            if (gotCrc == expectedCrc) {
                /* Same radio configs, so skip */
                goto exit;
            }
        }
    }
restart:
    status =
        UwbApi_SendRawCommand((uint8_t *)&UCI_RadioCfg_Init_Seq[0], sizeof(UCI_RadioCfg_Init_Seq), respBuf, &respLen);
    if (status == UWBAPI_STATUS_HPD_WAKEUP) {
        goto restart;
    }
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_00[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_00), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_01[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_01), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status =
        UwbApi_SendRawCommand((uint8_t *)&UCI_RadioCfg_Flash_Seq[0], sizeof(UCI_RadioCfg_Flash_Seq), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }

exit:
    // Exit code comes here
    return status;
}

// Tx_SP0_BPRF_Prmbl64_Sfd0_Sts0_Data6M8 :  #End

// Tx_SP1_BPRF_Prmbl64_Sfd0_Sts64_1_Data6M8 :  #Start

static tUWBAPI_STATUS RadioConfig_Tx_SP1_BPRF_Prmbl64_Sfd0_Sts64_1_Data6M8_0x1E(bool force_update)
{
    tUWBAPI_STATUS status;
    uint16_t respLen = 0x05;
    uint8_t respBuf[5];
    const uint8_t current_idx  = SR040_RADIO_CFG_IDX_0x1E_IDX;
    const uint16_t expectedCrc = SR040_RADIO_CFG_IDX_0x1E_CRC;
    /* clang-format off */
    const uint8_t UCI_RadioCfg_Init_Seq[] =
    {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00,0x02,
        kSR040_RadioCrc_InitDownload,
        SR040_RADIO_CFG_IDX_0x1E_IDX /* index */
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_00[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x00, 0x00,
        0x80,
        0x0B, 0x1F, 0x3A, 0x4E, 0x4D, 0x36, 0x12, 0xF3, 0xE6, 0xED, 0xFC, 0x07, 0x07, 0x02, 0xFB, 0xFA, 0xFC, 0x00, 0x01, 0x01, 0x00, 0xFE, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x1F, 0x3A, 0x4E, 0x4D, 0x36, 0x12, 0xF3, 0xE6, 0xED, 0xFC, 0x07, 0x07, 0x02, 0xFB, 0xFA, 0xFC, 0x00, 0x01, 0x01, 0x00, 0xFE, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x1F, 0x3A, 0x4E, 0x4D, 0x36, 0x12, 0xF3, 0xE6, 0xED, 0xFC, 0x07, 0x07, 0x02, 0xFB, 0xFA, 0xFC, 0x00, 0x01, 0x01, 0x00, 0xFE, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0x08, 0x01, 0x33, 0x00, 0x95, 0x0D, 0x00, 0x00, 0x83, 0xEB, 0x3F, 0x00, 0x41, 0xC0, 0x3C, 0x7C, 0x44, 0x70, 0x17, 0x01, 0xD4, 0x40, 0x30, 0x3C, 0x47, 0x3C, 0x57, 0x14,
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_01[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x80, 0x00,
        0x80,
        0xD0, 0x04, 0x53, 0x53, 0xC1, 0x41, 0xC4, 0xD4, 0x7D, 0x00, 0x10, 0x00, 0x07, 0x30, 0x03, 0x1F, 0x00, 0x00, 0x00, 0x00, 0xC4, 0xC1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x20, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x0A, 0x00, 0x80, 0x01, 0x14, 0x00, 0x80, 0x3F, 0x12, 0x00, 0xF8, 0x02, 0xE8, 0x73, 0x00, 0x00, 0x24, 0x08, 0x00, 0x00, 0xCD, 0x0C, 0x00, 0x00, 0x1D, 0x01, 0x13, 0x00, 0x1B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x04, 0x00,
    };
    const uint8_t UCI_RadioCfg_Flash_Seq[] =
    {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00,0x03,
        kSR040_RadioCrc_Finish,
        0x2D, 0xE7
    };
    /* clang-format on */
    if (!force_update) {
        uint16_t gotCrc = 0;
        status          = UwbApi_RadioConfigGetCrc(current_idx, &gotCrc);
        if (status == UWBAPI_STATUS_OK) {
            if (gotCrc == expectedCrc) {
                /* Same radio configs, so skip */
                goto exit;
            }
        }
    }
restart:
    status =
        UwbApi_SendRawCommand((uint8_t *)&UCI_RadioCfg_Init_Seq[0], sizeof(UCI_RadioCfg_Init_Seq), respBuf, &respLen);
    if (status == UWBAPI_STATUS_HPD_WAKEUP) {
        goto restart;
    }
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_00[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_00), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_01[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_01), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status =
        UwbApi_SendRawCommand((uint8_t *)&UCI_RadioCfg_Flash_Seq[0], sizeof(UCI_RadioCfg_Flash_Seq), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }

exit:
    // Exit code comes here
    return status;
}

// Tx_SP1_BPRF_Prmbl64_Sfd0_Sts64_1_Data6M8 :  #End

// Tx_DDFSCW :  #Start

static tUWBAPI_STATUS RadioConfig_Tx_DDFSCW_0x1F(bool force_update)
{
    tUWBAPI_STATUS status;
    uint16_t respLen = 0x05;
    uint8_t respBuf[5];
    const uint8_t current_idx  = SR040_RADIO_CFG_IDX_0x1F_IDX;
    const uint16_t expectedCrc = SR040_RADIO_CFG_IDX_0x1F_CRC;
    /* clang-format off */
    const uint8_t UCI_RadioCfg_Init_Seq[] =
    {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00,0x02,
        kSR040_RadioCrc_InitDownload,
        SR040_RADIO_CFG_IDX_0x1F_IDX /* index */
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_00[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x00, 0x00,
        0x80,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    };
    const uint8_t UCI_RadioCfg_DownLoad_Chunk_01[] = {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00, (1 + 2 + 1 + 0x80),
        kSR040_RadioCrc_DownloadChunk,
        0x80, 0x00,
        0x80,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x39, 0x13, 0x00, 0x10, 0x00, 0xE8, 0x73, 0x00, 0x00, 0x24, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, 0x04, 0x00,
    };
    const uint8_t UCI_RadioCfg_Flash_Seq[] =
    {
        (UCI_MT_CMD << UCI_MT_SHIFT) | UCI_GID_PROPRIETARY, EXT_UCI_MSG_RADIO_CONFIG_DOWNLOAD_CMD,
        0x00,0x03,
        kSR040_RadioCrc_Finish,
        0x7B, 0xCE
    };
    /* clang-format on */
    if (!force_update) {
        uint16_t gotCrc = 0;
        status          = UwbApi_RadioConfigGetCrc(current_idx, &gotCrc);
        if (status == UWBAPI_STATUS_OK) {
            if (gotCrc == expectedCrc) {
                /* Same radio configs, so skip */
                goto exit;
            }
        }
    }
restart:
    status =
        UwbApi_SendRawCommand((uint8_t *)&UCI_RadioCfg_Init_Seq[0], sizeof(UCI_RadioCfg_Init_Seq), respBuf, &respLen);
    if (status == UWBAPI_STATUS_HPD_WAKEUP) {
        goto restart;
    }
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_00[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_00), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status = UwbApi_SendRawCommand(
        (uint8_t *)&UCI_RadioCfg_DownLoad_Chunk_01[0], sizeof(UCI_RadioCfg_DownLoad_Chunk_01), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }
    status =
        UwbApi_SendRawCommand((uint8_t *)&UCI_RadioCfg_Flash_Seq[0], sizeof(UCI_RadioCfg_Flash_Seq), respBuf, &respLen);
    if (UWBAPI_STATUS_OK != status) {
        goto exit;
    }

exit:
    // Exit code comes here
    return status;
}

// Tx_DDFSCW :  #End
